Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create table using execute immediate

488411Aug 10 2010 — edited Aug 10 2010
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2010
Added on Aug 10 2010
4 comments
3,866 views