Informix SQL
I have 3 tables t1, t2, and t3.
Each has a primary key of 'job_no'.
t3 has a field called 'status'.
I wish to update t3.status by setting it to “XXX†when certain conditions are met.
My syntax looks like this :-
select t1.job_no
from t1, t2, t3
where t1.job_no = t2.job_no
and t2.job_no = t3.job_no
and (more conditions)
into temp ttemp;
update t3
set t3.status = “XXXâ€
where ttemp.job_no = t3.job_no
but I get error :- 522: Table (ttemp) not selected in query
Can anyone advise how to get around this ?
Thanks
Each has a primary key of 'job_no'.
t3 has a field called 'status'.
I wish to update t3.status by setting it to “XXX†when certain conditions are met.
My syntax looks like this :-
select t1.job_no
from t1, t2, t3
where t1.job_no = t2.job_no
and t2.job_no = t3.job_no
and (more conditions)
into temp ttemp;
update t3
set t3.status = “XXXâ€
where ttemp.job_no = t3.job_no
but I get error :- 522: Table (ttemp) not selected in query
Can anyone advise how to get around this ?
Thanks
0
Comments
All just a guess, but might be something to look into. Maybe to help confirm this suspicion you could try running the first statement by itself and see if an error is reported.