Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NOCOPY option in parameters

BS2012Dec 13 2012 — edited May 3 2013
Hi Everyone,
I found this "NOCOPY" option has been used a lot in so many stored procedures. As I googled, I found some facts and features as mentioned below.
The technique of OUT and IN OUT parameters was designed to protect original values of them in case exceptions were raised,
so that changes could be rolled back. Because a copy of the parameter set was made, rollback could be done. However, this method
imposed significant CPU and memory overhead when the parameters were large data collectionsfor example, PL/SQL Table or VARRAY types. 
With the new NOCOPY option, OUT and IN OUT parameters are passed by reference, which avoids copy overhead. However, parameter set
copy is not created and, in case of an exception rollback, cannot be performed and the original values of parameters cannot be restored.
So if this is true, what benefit we will be getting by using this option. I mean, in case of a failure transaction we will not be able to rollback for those
variables or parameters declared with NOCOPY option? If it is performance related, Ok but we can't rollback in case of any error.


Regards,
BS2012
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2013
Added on Dec 13 2012
4 comments
2,414 views