Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Date calculation when a closed day occure, loop back 1 day until the day is open
Totally unclear as to what you are trying to do. Maybe you are saying
update my table set date_to_check=date_closed;
commit;
(no looping needed)
Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "Xavier" <xcolinot_at_wanadoo.fr> wrote in message news:b3432721.0305210429.6903d95b_at_posting.google.com...Received on Wed May 21 2003 - 08:51:33 CDT
> Hi there,
>
> I need a sample code for doing this (newbie to Oracle... Sorry ;)
>
> This is the pseudo code problem (since I dunno how to put that in a
> Oracle SQL):
>
> _______________________________________________________________
> date_to_check = (today - 1 day);
>
> loop while (day_to_check) != closed
> {
> date_to_check = (date_to_check - 1 day);
> }
> _______________________________________________________________
>
> I'm supposed to put that in a SELECT Statement because I have to play
> in a strange DB that needs to do a realtime calculation for percent
> between 2 dates values in the same table with more than 1'000'000
> records... The stranger thing is that theses data can be
> pre-calculated but they don't want the DB to be modified....H E L P
> P L Z
>
> Thanx in Advance,
>
> Xavier