Click to See Complete Forum and Search --> : ORA-01031: insufficient privileges - procedure with synonym


noelg
04-05-2007, 10:31 AM
Hi,

Im trying to create a procedure which references a synonym.
The synonym is based on a table from a different schema .
I get this error when i try to create the procedure . .
PL/SQL: ORA-01031: insufficient privileges
Eg .

create or replace procedure MyProc
is
tot number ;
Begin
select count(*)
into tot
from synonym my_Syn_Name ;
END ;

If I run the 'select' statement from PLUS I have no errors.
The owner of the synonym is the same as the schema in which I am creating
the Procedure.

The owner of the table on which the synonym is based is in another schema.
The user (that is creating the procedure) has full DBA privileges .

Can anyone Help ? Th eversion of Oracle is 9.2

Thanks

noelg
04-05-2007, 11:13 AM
Its ok, granted select to underlying table .. .
problem solved

gandolf989
04-05-2007, 11:51 AM
You need a direct select grant on the underlying table.