Hi,
I have this code in Oracle Apex that generates multiple queries.
I want to execute the Insert queries generated as seen in the above screenshot. Now my code looks like this. please refer to code below.
DECLARE
l_insert varchar2(4000);
BEGIN
l_insert := q'{
WITH cols as (
SELECT drv.table_name,
(SELECT listagg(column_name,',') WITHIN GROUP (ORDER BY column_id)
FROM user_tab_cols
where table_name = drv.table_name
) column_list
FROM user_tables drv
where table_name like 'XT%'
) select q'[insert into ALL_PORT_OBJS (loadid,xtid,xt,name) SELECT 150 , 'xtid' , 'xt_xml', name FROM xt_xml]' metasql from cols}';
EXECUTE IMMEDIATE l_insert;
END;
This returns Statement processed but it actually did not execute the insert statements.
I think there is something else I need to do in the "select q'[insert into..." section?
Please help I am stucked on this. Any idea or suggestion is appreciated.
-Jazz