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: Can this sequence be done in Oracle?

Re: Can this sequence be done in Oracle?

From: The Ghost <The_at_Ghost.com>
Date: Sat, 24 Mar 2001 02:50:32 GMT
Message-ID: <YXTu6.116136$p66.33116838@news3.rdc1.on.home.com>

either reset the sequence in a cron job during off hours or dont use a sequence program the code....
 ie check to see if there is a record for today...

    if there is get max number

        add 1 and use it.
    else

       set the number -1 and use it

"Nick Tentomas" <Ntentoma_at_CSBFACMGT.CSBFM.DAL.CA> wrote in message news:3ABB7204.CC5DC66F_at_CSBFACMGT.CSBFM.DAL.CA...
> Hi ,
>
> I need to create a sequence that will reset it self every day:
>
> For example when it is executed for a certain data it will start from
> 1..and then always add 1.
>
> If execute it for the day after it will start again from 1..and then
> always add 1.
>
> I have a table where part of the key is the a date and a sequence
> number. The application was created in mysql and I was created the
> sequences manually there but now I am hoping to use Oracles features to
> acomplish this.
>
> Thanks in advance,
>
> Nick
>
>
>
Received on Fri Mar 23 2001 - 20:50:32 CST

Original text of this message

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