I have a create a query which returns a bunch of sql queries , was wondering if those queries can directly be run in one short via a script. Query goes like
with abc as (select a1, a2 from tableX),
xyz as (Select b1,b2 from tableY)
select a1, 'insert into tableZ values col1= '|| abc.a1||''
from abc , xyz
where abc.a1=xyz.b1;
so can i run all the inserts returned above in one go
execute immediate
within the loop to execute your dynamic SQL. But as others have said, your example does not present a case where that is needed.