Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SELECT from DUAL??
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 - 01:42:51 CST