Home » SQL & PL/SQL » SQL & PL/SQL » Which is better, returning a ref cursor or using out mode parameter in a function? (oralce 10.1.0.2.0)
Which is better, returning a ref cursor or using out mode parameter in a function? [message #282258] Wed, 21 November 2007 05:11 Go to next message
thisisnatesh
Messages: 92
Registered: March 2007
Member
Taking performance into consideration,
which is the better way?
"Returning a ref cursor or using out mode
parameter in a function?"

Please give me a needful answer.

Thanks in advance

Natesh
Re: Which is better, returning a ref cursor or using out mode parameter in a function? [message #282268 is a reply to message #282258] Wed, 21 November 2007 06:07 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Assuming that the parameter will be returning the same REF CURSOR, there will be nothing in it between the two methods.
Re: Which is better, returning a ref cursor or using out mode parameter in a function? [message #282293 is a reply to message #282268] Wed, 21 November 2007 06:54 Go to previous messageGo to next message
thisisnatesh
Messages: 92
Registered: March 2007
Member
Hi JRWBOTTOM

sorry. i didnt get you. i will be more detail.

create function f1(a int) return sys_refcursor
is
begin
.
.
.
end;

or

create function f1(a in out sys_refcursor) return int
is
begin
.
.
.
end;

which command helps me with respect to performance?

Thanks
Re: Which is better, returning a ref cursor or using out mode parameter in a function? [message #282301 is a reply to message #282293] Wed, 21 November 2007 07:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There is no difference.

By the way, why you return an int in your second function, why not use a procedure?

Regards
Michel
Re: Which is better, returning a ref cursor or using out mode parameter in a function? [message #282308 is a reply to message #282301] Wed, 21 November 2007 07:43 Go to previous message
thisisnatesh
Messages: 92
Registered: March 2007
Member
hi
thanks for the reply. just for an example purpose i used it.

-- NATESH --
Previous Topic: SQL query for table cloumn name
Next Topic: Output to Excel in 2 different Cell
Goto Forum:
  


Current Time: Sat Feb 08 07:59:56 CST 2025