GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 46 of 171    Print  
Can a function take OUT parameters. If not why?
No. A function has to return a value,an OUT parameter cannot return a value.



  
Total Answers and Comments: 5 Last Update: April 24, 2006   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Monal
 
I think a function can have out parameter; though its rare. The only restriction is that it cannot be called from a stand-alone sql statement; but can be called from a plsql block.

Above answer was rated as good by the following members:
seenu333p
September 16, 2005 09:44:14   #1  
Monal        

Answer
I think a function can have out parameter; though its rare. The only restriction is that it cannot be called from a stand-alone sql statement; but can be called from a plsql block.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 21, 2005 03:37:19   #2  
gauarv        

RE: Can a function take OUT parameters. If not why?
yes fuction can take out variable but the good programing practice is to not use the out parameter since function must return only one value to the calling envoirnment.
 
Is this answer useful? Yes | No
September 23, 2005 09:37:37   #3  
Mahesh        

RE: Can a function take OUT parameters. If not why?

yes functions can have out parmaters

Function:-

create or replace function fun_hello(p_mystring in varchar2 p_outstring out varchar2) return varchar2 is
begin
P_outstring: p_mystring;
return 'hello';
end fun_hello;

Testprog:

declare
in_par varchar2(10): 'hello1';
out_par varchar2(10): null;
out_par2 varchar2(10): null;
begin
out_par: fun_hello(in_par out_par2);
dbms_output.put_line(out_par||' '||out_par2);
end;


 
Is this answer useful? Yes | No
November 09, 2005 13:51:36   #4  
indrajit        

RE: Can a function take OUT parameters. If not why?
Yes. Functions can have OUT parameter.
 
Is this answer useful? Yes | No
April 24, 2006 06:53:02   #5  
ashvini        

RE: Can a function take OUT parameters. If not why?
Yes function can return a value but it is not a good programming practice
 
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