plsql - Execution of variable with Execute Immediate -


when trying run below code getting error "pl/sql compilation error". did wrong in ?

declare vsql varchar2(500);  begin    vsql:='begin    create global temporary table temp_subset      ( id number       ,"category"  varchar2(2048)       ,"class"  varchar2(2048)       ,"measure"  varchar2(2048)       ,"actuals year total"  varchar2(2048)       ,"col name" varchar2(256)       ,value varchar2(2048)     ); end;'; execute immediate vsql; end; 

thanks.

try this:

vsql:='    create global temporary table temp_subset      ( id number       ,"category"  varchar2(2048)       ,"class"  varchar2(2048)       ,"measure"  varchar2(2048)       ,"actuals year total"  varchar2(2048)       ,"col name" varchar2(256)       ,value varchar2(2048)     ) on commit delete rows'; 

if 2 tables needed created:

vsql:='   begin     execute immediate ''create table t1 ()'';     execute immediate ''create table t2 ()'';   end; '; 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -