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 236 of 241    Print  
Procedure Parameters
What is call by value and call by reference in parameters (IN, OUT, INOUT)?


  
Total Answers and Comments: 5 Last Update: April 17, 2009     Asked by: arunnaa 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: lisha.varghese
 

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 passe 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 paremeters



Above answer was rated as good by the following members:
varunskumar, suyog.wagh, MArcus_Datastage, deepti.kaur, samareshp, bhatnagar_neeraj, promisinganuj
October 23, 2008 02:15:15   #1  
manish_08 Member Since: October 2008   Contribution: 1    

RE: Procedure Parameters
OUT and IN OUT parameters is by default using call-by-value parameters
and IN parameter is default using call-by-reference parameter

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
October 24, 2008 10:19:29   #2  
premshanker.kumar Member Since: May 2008   Contribution: 1    

RE: Procedure Parameters
there is three parameter used in procedure
in in out out

 
Is this answer useful? Yes | No
November 08, 2008 20:52:41   #3  
kz4ora Member Since: October 2008   Contribution: 2    

RE: Procedure Parameters
There are 3 types parameters

IN - Default mode using this value is passed to procedure

OUT- Value is returned to calling environment

IN OUT- Does both- Value passed to procedure and can be used to return some value to calling environment



 
Is this answer useful? Yes | No
November 16, 2008 21:55:43   #4  
lisha.varghese Member Since: November 2008   Contribution: 1    

RE: Procedure Parameters

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 passe 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 paremeters


 
Is this answer useful? Yes | NoAnswer is useful 5   Answer is not useful 0Overall Rating: +5    
April 17, 2009 06:16:25   #5  
samareshp Member Since: April 2009   Contribution: 24    

RE: Procedure Parameters


In Parameter:: call by reference
OUT Parameter: call by value
IN OUT Parameter: call by value


if you use the hint NOCOPY with OUT Parameter and IN OUT Parameter then ::: call by reference

 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    


 
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