Home » RDBMS Server » Server Administration » Synonym For Procedure
Synonym For Procedure [message #352090] Mon, 06 October 2008 01:19 Go to next message
ORAGENASHOK
Messages: 240
Registered: June 2006
Location: Chennai
Senior Member
I want to create a synonym for a procedure which is in the another user.

Can anyone help me.
Re: Synonym For Procedure [message #352097 is a reply to message #352090] Mon, 06 October 2008 01:46 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Owner has to grant EXECUTE on the procedure to another user; the rest is trivial (just make sure you have named the owner along with the procedure name).

Here's an example (user 'scott' has created a procedure, while user 'mike' creates a synonym for scott's procedure):
SQL> create or replace procedure prc_test as
  2  begin
  3    dbms_output.put_line('Hello!');
  4  end;
  5  /

Procedure created.

SQL> grant execute on prc_test to mike;

Grant succeeded.

SQL> connect mike/lion@ora10
Connected.
SQL> create synonym prc_syn_test for scott.prc_test;

Synonym created.

SQL> set serveroutput on;
SQL> exec prc_syn_test;
Hello!

PL/SQL procedure successfully completed.

SQL>
Re: Synonym For Procedure [message #352247 is a reply to message #352097] Mon, 06 October 2008 21:15 Go to previous message
ORAGENASHOK
Messages: 240
Registered: June 2006
Location: Chennai
Senior Member
Thanks foot
Previous Topic: LISTENER consuming 95% CPU
Next Topic: Need to get the hex value of a character column.
Goto Forum:
  


Current Time: Sun Dec 01 19:20:08 CST 2024