Re: help [message #374760] |
Fri, 29 June 2001 05:36 |
GIRIDHAR KODAKALLA
Messages: 92 Registered: May 2001
|
Member |
|
|
Hai,
I think the main advantage of package functions over
ordinary functions is the overloading concept.
Suppose we have a function which should be overloaded,
then we have to go for the package only as we cannot
overload the general functions.
Then another advantage of the package functions is
the ability to access the local variables or local
objects declared in the package.
I think prior to oracle 8i, there was some difference
related to the PRAGMA RESTRICT REFERENCES.But with
oracle 8i, we need not give the PRAGMAs at all when
we call some function from SQL. But i dont remember
the difference about this pragmas.
Pls correct me if i am wrong.
Regards,
Giridhar Kodakalla
|
|
|
Re: help [message #374766 is a reply to message #374760] |
Fri, 29 June 2001 11:49 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
1.)Packages can be seen as a basic form of object oriented coding, by keeping related functions and procedures together. Packages also allow you to keep selected procedures and functions private and they're only available inside the package. I'm not sure that you can do this with procs??
2.)It makes code management easier because you don't have a proliferation of individual bits of code.
2.) Packages offer global variables for a session, so you can set these variables in one package and read them from somewhere else without having to continually pass them from one proc to another. Global pl/sql tables are available too.
3.) By compiling all the specs first, then all the bodies you can overcome code dependencies. In procedures and functions outside packages, if A depends on B and B depends on A you have a problem compiling them.
|
|
|
Re: help [message #374775 is a reply to message #374760] |
Fri, 29 June 2001 22:21 |
Palani
Messages: 8 Registered: June 2001
|
Junior Member |
|
|
Hi Giridhar,
In your answer, your are correct and at point# can be solved at package level by "FORWARD DECLARATION"
|
|
|