GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 4 of 156    Print  
Plz clarryfy this.Scinario is whether we can use out mode in functions?.I thought it's not possible. But in interview they are asking this.if i am telling no,they are not accepting me.Plz clarify this anyone.

  
Total Answers and Comments: 9 Last Update: May 28, 2008     Asked by: George Suresh 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 28, 2005 01:00:58   #1  
Ramesh        

RE: Plz clarryfy this.Scinario is whether we can use o...

It is possible using out mode in functions.

Regards

Ramesh G


 
Is this answer useful? Yes | No
October 09, 2005 04:50:08   #2  
Tez Member Since: October 2005   Contribution: 5    

RE: Plz clarryfy this.Scinario is whether we can use o...
Yes , PL/SQL provides an indirect way of returning values which are nothing but OUT parameters...... we specify the keyword OUT along with the name of the formal parameter...... If you know java....... this OUT parameter should get registered using the method registerOutParameter( )......... to specify the lack in value presently......
 
Is this answer useful? Yes | No
October 10, 2005 11:58:53   #3  
Sourabh        

RE: Plz clarryfy this.Scinario is whether we can use o...

Hi Friends,

We Can use the OUT parameter mode in the arguments to the function to return more than 1 value indirectly from the function.

Regards,

Sourabh


 
Is this answer useful? Yes | No
March 03, 2006 01:34:13   #4  
rajat_dba Member Since: February 2006   Contribution: 1    

RE: Plz clarryfy this.Scinario is whether we can use o...
yes we can use OUT parameter ... if you go thorough the difference between function and procedure you can easily understand it . regrdsrajat dey
 
Is this answer useful? Yes | No
March 27, 2007 04:05:06   #5  
hindol_saha Member Since: March 2007   Contribution: 15    

RE: Plz clarryfy this.Scinario is whether we can use o...
we can use out parameter in function......We can also use Ref Cursor for returning more than one value in function...like as pkg and procedure...........
 
Is this answer useful? Yes | No
July 10, 2007 07:15:26   #6  
chakraborty_sarkar Member Since: July 2007   Contribution: 2    

RE: Plz clarryfy this.Scinario is whether we can use o...
create or replace function OutBoundFunc(outBnd out varchar2)
return varchar2
is
BEGIN
outBnd := 'Sukalyan';
return 'Chakraborty';
END;


and call like:

declare
myOutPar varchar2(300) := '';
myReturn varchar2(300) := '';
BEGIN
myReturn = outboundfunc(myOutPar);
dbms_output.Put_line(myReturn || '---' || myOutPar);
END;

 
Is this answer useful? Yes | No
September 20, 2007 06:59:38   #7  
malavika        

RE: Plz clarryfy this.Scinario is whether we can use o...
Can you plz explain the code you have written ?
Regds
Malavika

 
Is this answer useful? Yes | No
November 16, 2007 03:05:43   #8  
kailaskaki Member Since: November 2007   Contribution: 1    

RE: Plz clarryfy this.Scinario is whether we can use o...
simple....First one is function and second block of code is block to call function.
while calling the function, return value will assign in one variable and out value will be in in out parameter...

 
Is this answer useful? Yes | No
May 28, 2008 08:03:34   #9  
ashishdixit Member Since: May 2008   Contribution: 5    

RE: Plz clarryfy this.Scinario is whether we can use out mode in functions?.I thought it's not possible. But in interview they are asking this.if i am telling no,they are not accepting me.Plz clarify this anyone.

i think this would solve your confusion...
CREATE OR REPLACE FUNCTION out_func (v_empno IN emp.empno%type,v_sal OUT emp.sal%type)
RETURN emp.ename%type
is
v_ename emp.ename%type;
BEGIN
select sal,ename into v_sal,v_ename from emp where empno = v_empno;
return (v_ename);
end;
/

--calling body

declare
var_to_hold_return_Val emp.ename%type;
var_to_hold_out_param emp.sal%type;
begin
var_to_hold_return_Val :=out_func(7369,var_to_hold_out_param);
dbms_output.put_line ('this value is returned using return clause ' ||var_to_hold_return_Val);
dbms_output.put_line ('this value is returned using out param  '||var_to_hold_out_param);
end;
/


--output

this value is returned using return clause SMITH
this value is returned using out param  800

PL/SQL procedure successfully completed.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape