Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DECODE FUNCTION

Status
Not open for further replies.

dshaw21369

Programmer
Jul 8, 2002
64
Hi,
Can you call a procedure when returning value using the DECODE function?
 
Dshaw,

I'm not certain what your question means, so if you can clarify, that would be helpful. I can tell you that PL/SQL does not support the DECODE function directly. If you want to use DECODE withing PL/SQL, it must be within a straight SQL statement within PL/SQL, otherwise you receive a pass-1 interpreter error.

I'm happy to share more if you can clarify your question.

Dave
 
You can use functions quite freely with DECODE. But performance is another chapter, especially when using aggregatefunctions like SUM,...

Stefan
 
I guess I'm trying to ask, can you call a procedure from the DECODE function.
 
DECODE is a function used in an SQL statement. A DECODE cannot call a stored procedure; however, it can use another function as one or more of it's parameters. Example:
Code:
select decode(COL1,'X','Y',MY_FUNCTION(COL1))
from   MY_TABLE

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top