troubleshooting Question

when to use NOCOPY and when to avoid

Avatar of royjayd
royjayd asked on
Oracle Database
8 Comments1 Solution555 ViewsLast Modified:
hi guys

I am trying to understand when to use NOCOPY and when to avoid it. The documentation says

Requests that the compiler pass the corresponding actual parameter by reference instead of value (for the difference, see "Subprogram Parameter Passing Methods"). Each time the subprogram is invoked, the optimizer decides, silently, whether to obey or disregard NOCOPY.

i am writing a store procedure and my package specification is like this ::

create or replace PACKAGE STORE_DATA
AS

TYPE store_cur IS REF CURSOR;
 
PROCEDURE get_store_data(in_year NUMBER
                                            ,out_store_cursor OUT NOCOPY  store_cur);
END STORE_DATA

This procedure is called from a java program.
so now going back to the documentation'Requests that the compiler pass the corresponding actual parameter by reference instead of value '
it means the compiler passes the cursor 'out_store_cursor '  by reference instead of by value back to the java program, right?
so what is the author trying to say?

thx
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros