Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: sysdate while updating
How about this?
declare
midnight date;
begin
select trunc(sysdate) into midnight from dual;
update temp set vardate = midnight;
end;
That will guaratee that all your values are set to the beginning of "today". For long nested queries on a slow machine you'll get different values every second.
Why write ambiguous code if you don't need to? --Bob.
Igor Sereda wrote in message <3551FFD5.B0949920_at_spb.runnet.ru>...
>Hello,
>
>Does the Oracle lock the value of the function while performing
>long queries as such:
>
>UPDATE TABLE SET COLUMN = SYSDATE;
>
>I ran a test and learned that the value of sysdate is being calculated
>once. Is there a way to force Oracle to recalculate functions
>each time (for each row, heh? :)
>
>Regards,
>Igor
>
>--
>Igor Sereda,
>ITC, Russia
Received on Thu May 07 1998 - 13:24:10 CDT
![]() |
![]() |