Re: Uses of Dual

From: Donna Kray <kray.donna_at_mlink.motors.ge.com>
Date: 1996/08/29
Message-ID: <50471r$g4r_at_crissy.ge.com>#1/1


<adizon_at_mail.us.net> wrote:
>I know I can get the user's name by doing 'select user from dual' and I can
>also get the next sequence number with 'select seq.nextval form dual'. Are
>there any more uses of dual aside from these?
>Thanks.
>
>Lito Dizon
>adizon_at_us.net
>


<select SYSDATE from dual;> is a common use, I'll bet.

I use dual to test out functions, to see if I get the expected results. It is very helpful when there is a whole bunch of nested ones or if I don't know how it will handle nulls or arguments out of range.

E.g. select decode(substr('RTVI#IUER', 3, instr('RTVI#IUER', '#') - 3), 'VI', 'SIX', 'RTVI#IUER')
from dual;

When the function is working right, I can substitute the column_name that would take the place of 'RTVI#IUER' for this example. Of course this example makes no sense, but you get the gist, eh?

DL Kray Received on Thu Aug 29 1996 - 00:00:00 CEST

Original text of this message