Hi,
I have defined a cursor by joining 2 tables.
Can I use "CURRENT OF" to update values in BOTH the tables which are joined in the cursor definition?
eg. declare
cursor my_cur is
select t1.col_1, t1.col_2, t2.col_1, t2.col_22
from t1, t2
where t1.col_1 = t2.col_1
for UPDATE OF t1.col_3, t2.col_3;
open my_cur;
loop
fetch my_cur into my_rec;
...
...
update t1 set col_3 = 'Y' where CURRENT OF my_cur; --(i)
update t2 set col_3 = 'Y' where CURRENT OF my_cur; --(ii)
end loop;
So is it syntactically correct to UPDATE the joined tables
t1 and t2 as in (i) and (ii) above.
Thanks
I have defined a cursor by joining 2 tables.
Can I use "CURRENT OF" to update values in BOTH the tables which are joined in the cursor definition?
eg. declare
cursor my_cur is
select t1.col_1, t1.col_2, t2.col_1, t2.col_22
from t1, t2
where t1.col_1 = t2.col_1
for UPDATE OF t1.col_3, t2.col_3;
open my_cur;
loop
fetch my_cur into my_rec;
...
...
update t1 set col_3 = 'Y' where CURRENT OF my_cur; --(i)
update t2 set col_3 = 'Y' where CURRENT OF my_cur; --(ii)
end loop;
So is it syntactically correct to UPDATE the joined tables
t1 and t2 as in (i) and (ii) above.
Thanks