Saturday 25 May 2013

What is disadvantage of NOCOPY Parameter?

However, you need to be extremely careful while using this method in coding for high priority data transactions. When you pass parameters to a procedure by reference, any change that happens on the passed Parameters gets updated in the same memory location as the Actual parameter. So when an exception occurs in a procedure/function, these changes are not Rolled back. To be precise, the PL/SQL engine cannot rollback these parameter changes. So, if the actual values get changed, then it may result in incorrect results.
Thus, to conclude, it is up to a Developer to take a trade-off between using or not using the NOCOPY parameter. NOCOPY could provide better performance by reducing Memory and CPU cost, but at the same time, could result in incorrect results too.

No comments:

Post a Comment