pl/sql compiler options [message #39897] |
Thu, 22 August 2002 02:30 |
Anthony
Messages: 48 Registered: September 2000
|
Member |
|
|
Hi all,
I am looking at passing an object between two procedures in the same package. The first procedure is called from an API which does some validation and then passes a large object to the second procedure in the package which then inserts a record. The second procedure is also going to be called by a GUI sitting on a client sending the same large object.
My question is how does the pl/sql compiler work out which way to pass the parameters to the second object? In the first instance, as both procedures are in the same package located on the same database, I imagine that pl/sql compiler decides to pass the parameters 'by reference'. In the second case because the GUI is on the client the parameters will have to be sent over 'by value'.
Will the packet be compiled so that the parameters in the first place be automatically transferred by reference and then by value in the second instance?
In the first instance the parameters I have defined are not global variables.
Anything else which might be of interest?
TIA
Anthony
|
|
|
Re: pl/sql compiler options [message #39909 is a reply to message #39897] |
Thu, 22 August 2002 10:22 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
Passed by value unless you use the NOCOPY hint. Note that it is not a compiler directive but a hint. Allplies to IN/OUT and OUT only. There are side effects to test it. If the proc starts changing the out parm and then hits an exception - then whatever has already been changed to the OUT parm is already one. When passing by value - it wont pass anything back if it hits an exception (unhandled).
PROCEDURE ABC (p_val1 IN NUMBER, p_array1 OUT NOCOPY NumArray) IS...
|
|
|