Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: errors with CREATE SYNONYM procedure

RE: errors with CREATE SYNONYM procedure

From: Mercadante, Thomas F <NDATFM_at_labor.state.ny.us>
Date: Fri, 10 May 2002 07:40:35 -0800
Message-ID: <F001.0045E3DE.20020510074035@fatcity.com>


Bill,

Does the OWNER of the proc have CREATE PUBLIC SYNONYM system priv?

Tom Mercadante
Oracle Certified Professional

-----Original Message-----
Sent: Friday, May 10, 2002 11:24 AM
To: Multiple recipients of list ORACLE-L

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-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Mercadante, Thomas F
  INET: NDATFM_at_labor.state.ny.us
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-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri May 10 2002 - 10:40:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US