hi all-
what happens to the values contained by myvar in a "select value into myvar" statement executed inside a "foreach x_curs into r_s.*" loop?
here's my code:
foreach d_curs into dat.*
select fssitecd,sotadat into site,sdate
from fssps
where dat.indoc = fssps.sono
and dat.apart = fssps.part
and dat.inlots = fssps.fsserln
insert into tmpall
(indoc,apart,inlots,cpart,serln,fssitecd,sotadat)
values(dat.indoc,dat.apart,dat.inlots,dat.cpart,dat.serln,site,sdate)
end foreach
-------------
suppose i only want to do the insert if i get values for "site" and "sdate"....there are cases when i won't.
so...in each successive pass, will site and sdate retain their values from the prior pass if there query returns nothing in this pass?
what happens to the values contained by myvar in a "select value into myvar" statement executed inside a "foreach x_curs into r_s.*" loop?
here's my code:
foreach d_curs into dat.*
select fssitecd,sotadat into site,sdate
from fssps
where dat.indoc = fssps.sono
and dat.apart = fssps.part
and dat.inlots = fssps.fsserln
insert into tmpall
(indoc,apart,inlots,cpart,serln,fssitecd,sotadat)
values(dat.indoc,dat.apart,dat.inlots,dat.cpart,dat.serln,site,sdate)
end foreach
-------------
suppose i only want to do the insert if i get values for "site" and "sdate"....there are cases when i won't.
so...in each successive pass, will site and sdate retain their values from the prior pass if there query returns nothing in this pass?