Hello Experts,
I am trying to create table at runtime using EXECUTE immediate in anonymous block. I am passing table name as parameter in block. Please find below piece of code,
It continuously giving error and not allowing to create table runtime.
Declare
Operation number := &1;
sqlstring varchar2(1000);
BEGIN
sqlstring:= 'Create table ' || &2 ||
' as SELECT Order_ID,'||
'group_id,'||
'FROM Transaction_table';
EXECUTE IMMEDIATE sqlstring;
End;
I am calling this block using this argument;
@/tmp/Createtable.sql 1 Order_table;
also tried this
@/tmp/Createtable.sql 1 'Order_table';
But both giving same error.
ORA-06550: line 4, column 34:
PLS-00201: identifier 'Order_table' must be declared
Help on this please.