Can a function take OUT parameters. If not why?

No. A function has to return a value,an OUT parameter cannot return a value.

Showing Answers 1 - 5 of 5 Answers

Monal

  • Sep 16th, 2005
 

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.

gauarv

  • Sep 21st, 2005
 

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.

  Was this answer useful?  Yes

Mahesh

  • Sep 23rd, 2005
 

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;

  Was this answer useful?  Yes

indrajit

  • Nov 9th, 2005
 

Yes. Functions can have OUT parameter.

  Was this answer useful?  Yes

ashvini

  • Apr 24th, 2006
 

Yes ,function can return a value but it is not a good programming practice

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions