|
-
I think you're going to have to serialise on (say) a single-row table containing the EffectiveDate and FirstSequence, in order to deal with the date change & sequence reset. This will only happen once per day so shouldn't cause performance problems (?) - the rest of the time you can just use the sequence.nextval:
a) check & deal with date change:
Select * from serial_table
where EffectiveDate <> trunc(sysdate) for update;
If you get a row, update it with trunc(sysdate) & my_seq.nextval.
b) in all cases:
Build your Invoice number out of: sysdate & (my_seq.nextval - FirstSequence)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|