Re: Using DECODE in stored function
From: Mike Philippens <mikephil_at_metropolis.nl>
Date: 1996/01/25
Message-ID: <DLrAq8.8Is_at_news.metropolis.nl>#1/1
Date: 1996/01/25
Message-ID: <DLrAq8.8Is_at_news.metropolis.nl>#1/1
shemminga_at_cix.compulink.co.uk ("Stuart Hemming") wrote:
>If you're trying to use it in a PL/SQL statement rather than an SQL
>statement it won't work. However, I think you could fudge it by using
>SELECT <your decode function> into <variable> from dual;
True, but you don't want to do unnecesary database access (allright,
accessing dual isn't the killer load you would imagine - but it's the
principle that counts).
PL/SQL offers the IF..THEN...END IF; structure, so there's no real
need for decode anymore inside an PL/SQL block. Only if you would want
your program to be obscure and hard-to-read you should use a decode
construct. IF is much more clear.
- This message was brought to you in stereo (where available) by: +-------------------------------------------------+ / Mike Philippens - Gorinchem - The Netherlands / / mikephil_at_metropolis.nl / / http://www.metropolis.nl/~mikephil/index.html / +-------------------------------------------------+