Home » SQL & PL/SQL » SQL & PL/SQL » Output Parameter in pipelined function (Windows XP Prof)
Output Parameter in pipelined function [message #348016] Mon, 15 September 2008 07:11 Go to next message
Bis_muhammad
Messages: 1
Registered: September 2008
Junior Member
Can I use an output parameter in a Table Function (Pipelined)?
Something like this:

Create or replace function (str Out Varchar2)
Return x pipelined
As
Begin
...
End;
Re: Output Parameter in pipelined function [message #348018 is a reply to message #348016] Mon, 15 September 2008 07:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
No.
A pipelined function can be called only from SQL and SQL does not allow functions with OUT parameters.

Regards
Michel
Re: Output Parameter in pipelined function [message #348045 is a reply to message #348016] Mon, 15 September 2008 08:35 Go to previous message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
Further, as a general rule, out parameters in a function are BAD FORM. The idea of a function is to return only one value through its return item. Using out parameters in a function can thus lead to "side affects" in the code.

Think of out parameters in a function as akin to using GOTO.

One never actually must use GOTO.
There is one possibly two places where GOTO is quite useful and does not break "normalized code" strategies.

So too does it go for out parameters in functions. For examples, I suggest you examine Oracle functions and look for the few in which Oracle has used out parameters in a function. I know these exists for I have seen them. I do not however recall any one in particular so if you are really interested in "GOOD FORM" coding, you will have to do some searching.

Good luck, Kevin
Previous Topic: i need help converting sqlserver triggers to oracle
Next Topic: pointers
Goto Forum:
  


Current Time: Fri Dec 06 18:03:37 CST 2024