Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need help about "Statement is not allowed in interactive mode" error

77 views
Skip to first unread message

DVD

unread,
Jul 1, 2009, 11:59:37 AM7/1/09
to
Hi,
I need help about a query that doesn't work, with "Statement is not
allowed in interactive mode".

It is a query that correctly works with only an insert in the loop,
but it doesn't work with the second insert statement (insert into
select).

Can you help me? Thank you.

a = 0

SELECT MAX(Fatspe.cod_fatt) AS max_a;
FROM ;
fatspe;
INTO CURSOR cur_a

select cur_a
go top

a = cur_a.max_a

select b.cod_fatt, b.num_fatt, b.data_fatt, b.tot_fatt, b.imp_iva_fa,
b.cod_fornit, b.iva_fatt, b.impon_fatt, b.data_scad_ into cursor
cur_appo ;
FROM query_fatspe_dvd b

select cur_appo
go top

do while not eof()

a = a+1

INSERT INTO fatspe values (a, cur_appo.num_fatt, cur_appo.data_fatt,
cur_appo.tot_fatt, cur_appo.imp_iva_fa, cur_appo.cod_fornit,
cur_appo.iva_fatt, cur_appo.impon_fatt, cur_appo.data_scad_)

INSERT INTO carico SELECT a, c.cod_barre, c.costo, c.qta_carico,
c.filler FROM query_carico_dvd c WHERE c.cod_fatt = cur_appo.cod_fatt

select cur_appo
skip

loop

enddo

select cur_appo
use

Bernhard Sander

unread,
Jul 10, 2009, 4:29:39 PM7/10/09
to
Hi DVD,

> INSERT INTO carico SELECT a, c.cod_barre, c.costo, c.qta_carico,
> c.filler FROM query_carico_dvd c WHERE c.cod_fatt = cur_appo.cod_fatt

Just a guess: maybe foxpro does not like that WHERE clause (but it should!).

Maybe store the value of cur_appo.cod_fatt to a variable and compare with this
variable.

Hth

Bernhard Sander

Message has been deleted
0 new messages