Create table using execute immediate
488411Aug 10 2010 — edited Aug 10 2010Hi all,
I am getting an issue with creating tables using execute immediate statement within the stored procedure.
When I put in below statements as a stored procedure:
DECLARE
v_query_string VARCHAR2 (1000);
BEGIN
v_query_string :=
'CREATE TABLE IDS_ADDRESS AS
SELECT * FROM ADDRESS WHERE PARTITION_KEY = ''P_62308_1000''';
EXECUTE IMMEDIATE v_query_string;
END;
I am getting the error - ORA-01031: insufficient privileges.
Should I need to get any privilege like create any table to get this done? If so, Why am I not getting any error if I execute that as a PLSQL block?
Please let me know if I have misunderstood anything.
Please help me in this regard.
Warm Regards
Swami