I wrote a WITH statement as follow
with tempTable as ( select t1.c1, t1.c2, t2.c3 from (t1 join t2))
select * from tempTable gives me:
select * from tempTable
temptable is not table but it is CTE. you can use it directly in the loop as follows:
temptable
BEGIN for i in (select * from (with tempTable as ( select t1.c1, t1.c2, t2.c3 from (t1 join t2)) select * from tempTable) ) LOOP DBMS_OUTPUT.PUT_LINE (i); END LOOP; END;
1.4m articles
1.4m replys
5 comments
56.8k users