Synonyms for packages

Synonyms for packages

Post by Mark Auri » Wed, 10 Dec 1997 04:00:00



What is the best way to make my package available to other people? Would it

be to make my package spec a public synonym? Or do I also need to make
the procedures in my package body public synonyms?
Thanks, Mark

 
 
 

Synonyms for packages

Post by Michael A. Ri » Wed, 10 Dec 1997 04:00:00


What I did was created a public synonym for the package.  This hides the
schema that owns the package.  Then refer to your procedures and functions
in your package as PKG_SYNONYM.PROCEDURE or PKG_SYNONYM.FUNCTION



>What is the best way to make my package available to other people? Would
it

>be to make my package spec a public synonym? Or do I also need to make
>the procedures in my package body public synonyms?
>Thanks, Mark



 
 
 

Synonyms for packages

Post by Nares » Wed, 10 Dec 1997 04:00:00


Mark,

It will suffice to make a public synonym for your package and to grant
execute on the package to all users that need it. You do not have to
create synonyms for each individual unit (function or procedure) within
a package.

Naresh.


> What is the best way to make my package available to other people? Would it

> be to make my package spec a public synonym? Or do I also need to make
> the procedures in my package body public synonyms?
> Thanks, Mark


 
 
 

Synonyms for packages

Post by Thomas Vany » Wed, 10 Dec 1997 04:00:00


I like to create public synonyms for procedures, functions, packages, etc.
With packages remember that you can create a synonym for the package but
not for the individual functions or procedures within the package.
Invocation is via SYNONYM_NAME.PACKAGE_ELEMENT.
--
Thomas W. Vanya
Oracle and OracleRdb Database Administrator
Eastman Chemical Company
-------------------------------------------------------------------------
(Due to proliferation of spammers, remove nospam from address.)



> What is the best way to make my package available to other people? Would
it

> be to make my package spec a public synonym? Or do I also need to make
> the procedures in my package body public synonyms?
> Thanks, Mark


 
 
 

1. 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:
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.

2. Installation problem

3. Synonym for procedure within package?

4. How to get the DBServername into my VB program ?

5. synonym on synonym is it possible.

6. Foxpro encryption

7. Run a DTS package from another DTS package

8. Moving package and chaning sub package calls!

9. DTS package not executing an inside DTS package

10. Execute Package Task On Remote Server Hangs Package

11. Calling DTS package from DTS package

12. Package run correctly in dts designer, but run error when schedual this package