Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> errors with CREATE SYNONYM procedure
I've developed a procedure that will create a public synonym on an object,
which I'd eventually like to call from a ddl "after create on schema"
trigger.
But I'm first working on this piece - I get an INSUFFICIENT PRIVILEGES error
(ORA-1031) on the EXECUTE IMMEDIATE line. The user running the proc has
both DBA role and specifically the CREATE ANY SYNONYM procedure, which
should be enough. I can create the synonym manually from SQL*Plus, but
never through this proc . . . any ideas?
thx
here's the code, which compiles perfectly:
CREATE OR REPLACE procedure CREATE_GRANTS (
p_lwowner varchar2, p_objname varchar2, p_objtype varchar2) AS
pragma autonomous_transaction;
v_lwowner varchar2(30) := p_lwowner; v_objname varchar2(30) := p_objname; v_objtype varchar2(30) := p_objtype; v_sql varchar2(200); begin v_sql := 'create public synonym ' || v_objname || ' for ' || v_lwowner || '.' || v_objname; execute immediate (v_sql);
end;
/
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Magaliff, Bill INET: Bill.Magaliff_at_lendware.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Fri May 10 2002 - 10:23:35 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |