NOCOPY mode

What is the purpose of NOCOPY mode in procedures?

Questions by thirupathireddy   answers by thirupathireddy

Showing Answers 1 - 3 of 3 Answers

When a parameter is passed as an IN variable, it is passed by reference. Since it will not change, PL/SQL uses the passed variable in the procedure/function. When variables are passed in OUT or INOUT mode, a new variable is define, and the value is copied to the passed variable when the procedure ends. If the variable is a large structure such as a PL/SQL table or an array, the application could see a performance degradation cause by copying this structure.

The NOCOPY clause tells to PL/SQL engine to pass the variable by reference, thus avoiding the cost of copying the variable at the end of the procedure. The PL/SQL engine has requirements that must be met before passing the variable by reference and if those requirements are not met, the NOCOPY clause will simply be ignored by the PL/SQL engine.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions