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!

Handling 'insufficient privileges' in a procedure used to create a view

smshindeNov 15 2006 — edited Nov 15 2006
Dear All,
I have designed a procedure which creates a sql statement dynamically and later use it to create a view.
The create view statement is executable as I tried to execute the same using Oracle SQL Developer and got executed.
So I add this statement to the procedure:

EXECUTE IMMEDIATE 'CREATE OR REPLACE VIEW TEMPVIEW AS ' || sql_command;

But I am getting the following error:
ORA-01031: insufficient privileges
Why this may be?
I am able to execute the statement when i log with proper privileges in SQL Developer.
Then how to run it in PL/SQL procedure?

-Sameer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2006
Added on Nov 15 2006
7 comments
1,449 views