GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 166 of 241    Print  
what is the use of nocopy parameter in oracle procedure
Hi,
What is nocopy parameter in oracle procedure. what is the use of it. In which situation,we can use the nocopy parameter.
Thanks,
Saravanan.P



  
Total Answers and Comments: 8 Last Update: November 05, 2009     Asked by: ily_saravanan 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 26, 2007 00:02:09   #1  
subbaraovangalli Member Since: March 2007   Contribution: 17    

RE: what is the use of nocopy parameter in oracle proc...
no copy parameter is an argument in a procedure
it says to oracle to pass the variable value back to the user as quickly as possible.

 
Is this answer useful? Yes | No
March 26, 2007 02:45:50   #2  
Jegadeesan        

RE: what is the use of nocopy parameter in oracle proc...
NOCOPY is a IN OUT COPY Which is used avoid the overhad of copying IN OUT Parameter Values. If IN OUT parameter returns huge records we can specify the NOCOPY to copy the values.

The PLSQL Engine first makes a copy of the record and then during program executing makes a changes to that copy.

Regards
Jegadeesan

 
Is this answer useful? Yes | No
March 27, 2007 05:49:57   #3  
tharik Member Since: March 2007   Contribution: 1    

RE: what is the use of nocopy parameter in oracle proc...
NOCOPY will instruct Oracle to pass the argument as fast as possible. This can significantly enhance performance when passing a large value.
 
Is this answer useful? Yes | No
April 18, 2007 07:31:40   #4  
vmahawar        

RE: what is the use of nocopy parameter in oracle proc...
NOCOPY Parameter in Oracle Procedure is used to pass arguments to the any procedure and function as Reference to improve the performance of the code.
This is done in case the arguments like records pl/sql tables are passed to the called procedures.

 
Is this answer useful? Yes | No
July 22, 2008 23:55:29   #5  
sippsin Member Since: June 2006   Contribution: 6    

RE: what is the use of nocopy parameter in oracle procedure
Ussually IN paramter is pass by value and OUT/IN OUT are pass by refererence....

If one wants to send the IN paramter too as pass by reference he could add NOCOPY
parameter....

advantage is always less memory usage

disadvantage is when there is a change happened to the Reffered value and a rollback occurs in the procedure the change of value would be retained.... it could not be rolled back....

so I beleive that it is always safe to work without the NOCOPY parameter.....

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
October 10, 2008 13:18:40   #6  
ratna82 Member Since: October 2008   Contribution: 2    

RE: what is the use of nocopy parameter in oracle procedure
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.


 
Is this answer useful? Yes | No
November 10, 2008 09:35:33   #7  
amianan Member Since: November 2008   Contribution: 1    

RE: what is the use of nocopy parameter in oracle procedure
TO PASS OUT AND INOUT Parameters by refrenece instead of value.
 
Is this answer useful? Yes | No
October 29, 2009 10:48:42   #8  
vanishavadlya Member Since: October 2009   Contribution: 3    

RE: what is the use of nocopy parameter in oracle procedure
Three types of parameter modes

1) IN parameter mode- This mode is used to pass values to the calling module when invoked. The value of IN parameter can't be changed in the module.


2) OUT parameter mode -This mode is used to return a value to the main block. The value of OUT parameter can change anywhere in the program.


3) IN OUT parameter mode-This mode is used to pass values to the calling module and return a value to the main block. The value of IN OUT parameter can change anywhere in the program.


In Call By value the copy of actual parameter is passed to the formal parameter So any changes to the formal parameter doesn't affect the actual parameter.


In Call By reference the address of actual parameter is passed to the formal parameter so any changes to the formal parameter will change the actual parameter also because both of them are pointing to the same memory location. Here no copying is required.


The IN parameter is passes by reference so we can't change the value of IN parameter inside the module It acts as a constant But the OUT and IN OUT parameters are passed by value we can change the values of OUT & IN OUT parameters if you use the hint NOCOPY with OUT Parameter and IN OUT Parameter then ::: call by reference



 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape