pl/sql and sql not acting the same

Jeff Kish

Member²
Hi.
I login to pl/sql and test my one line procedure:

execute immediate 'create or replace view JTK as select * from myschema.asset';

I get insufficient privileges.
I contact the dba and get the privileges.

I get the same error.
If I stay in my current session and do a 'new' sql window,
and enter this:

create or replace view JTK as select * from myschema.asset

It runs perfectly.
From the pl/sql windows in a procedure (in a package) it gets the error:
ora-01031: insufficient privileges

Can someone point out what I'm doing wrong here? Is it because it is in a package or something?
thanks
Jeff
 
I assume you have the "create view" system privilege granted through a role. For the "execute immediate" statement in PL/SQL you need privileges granted directly to the user instead of indirectly through a role.
 
Back
Top