Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SELECT from DUAL??
Great, thanks a bunch for the help, everyone!
I am using 8i, and as such, I guess I'll never bother using a select from
dual (except in case of sequnces...)
Thanks again.
"Stephan Born" <stephan.born_at_beusen.de> wrote in message
news:3A669E7B.15A7DF31_at_beusen.de...
> Joseph Ranseth wrote:
> >
> > I have come across many instances where people use a select from dual to
> > determine or assign a value to a local variable, for example:
> >
> > SELECT sysdateinto l_date FROM dual
> >
> > what is the benefit of this over using a standard assignment expression?
> > ie: l_date := sysdate;
>
> if you want to get a new value fron a sequence you cant do the
> following:
>
> declare
> new_val number;
> begin
> new_val := my_sequence.nextval;
> end;
>
> You have to do it this way
>
> declare
> new_val number;
> begin
> select my_sequence.nextval into new_val from dual;
> end;
>
> The same with decode(...)
>
> At least in Oracle7
>
> Regards, Stephan
Received on Thu Jan 18 2001 - 10:37:04 CST
![]() |
![]() |