Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sysdate while updating

Re: sysdate while updating

From: Bob Nightingale <rnightingale_at_comshare.com>
Date: Thu, 7 May 1998 13:24:10 -0500
Message-ID: <6isunf$ere$3@inet-prime.comshare.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US