Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Is is possible to create Alias/Synonym for package.procedure names ?
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:
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:
Please let me know any other way I could achieve synonyms on package.procedure names. Thanks. Received on Fri Oct 29 1999 - 08:43:58 CDT