Handling 'insufficient privileges' in a procedure used to create a view
smshindeNov 15 2006 — edited Nov 15 2006Dear 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