Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is is possible to create Alias/Synonym for package.procedure names ?
A copy of this was sent to Peter Fullbright <pfullbright_at_hotmail.com>
(if that email address didn't require changing)
On Fri, 29 Oct 1999 08:43:58 -0500, you wrote:
>Hi Folks,
>
>We have a C++ client with Oracle as a backend server. The project
>is production right now. The C++ plus routines, call database
>procedures using ODBC.
>
>I am an Oracle DBA and wanted to overload a procedure, and so wanted
>to put the original database procedure and the new overloaded
>procedure into a package, as you all know, procedures cannot be
>overloaded unless they are inside a package.
>
>My question is, Is it possible to create a public synonym for a
>package. procedure? Let me explain with an example:
>
>create or replace package test
>is
> procedure proc1 (v1 varchar2);
> procedure proc2 (v1 varchar2, v2 varchar2);
>end test;
>/
>
>create or replace package body test
>is
> procedure proc1 (v1 varchar2)
> is
> begin
> dbms_output.put_line(v1);
> end proc1;
>
> procedure proc2 (v1 varchar2, v2 varchar2)
> is
> begin
> dbms_output.put_line(v1||v2);
> end proc2;
>
>end test;
>/
>
>Now I want to able to create a synonym like this:
>
>SQL> create public synonym test_proc1 for test.proc1;
>SQL> create public synonym test_proc2 for test.proc2;
>
>and then be able to use it as follows
>
>SQL> execute test_proc1('A');
>SQL> execute test_proc2('A','B');
>
>IS IT POSSIBLE TO DO SOMETHING LIKE THIS. I am getting the following
>errors:
>
>SQL> exec test_proc1('A');
>begin test_proc1('A'); end;
>
> *
>ERROR at line 1:
>ORA-06550: line 1, column 7:
>PLS-00201: identifier 'TEST_PROC1' must be declared
>ORA-06550: line 1, column 7:
>PL/SQL: Statement ignored
>
>SQL> exec test_proc2('A','B');
>begin test_proc2('A','B'); end;
>
> *
>ERROR at line 1:
>ORA-06550: line 1, column 7:
>PLS-00201: identifier 'TEST_PROC2' must be declared
>ORA-06550: line 1, column 7:
>PL/SQL: Statement ignored
>
>Please let me know any other way I could achieve synonyms on
>package.procedure names. Thanks.
short of writing a standalone procedure that calls the packaged procedure -- no, there are no synonyms for packaged procedures - just for the package itself.
--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Oct 29 1999 - 09:43:57 CDT