Complex sequence [message #2808] |
Wed, 14 August 2002 07:12 |
scott
Messages: 73 Registered: September 1999
|
Member |
|
|
I need to write a sequence that 1) begins at 1 but is padded with 4 zeros. The first number would be 00001, then 00002 and so on. Also 2) The sequence must be reset to 00001 on Dec 31 every year.
Does anyone have know how to do this? Thanks in advance.
Scott
|
|
|
Re: Complex sequence [message #2824 is a reply to message #2808] |
Thu, 15 August 2002 06:20 |
Abul Fazal
Messages: 39 Registered: February 2002
|
Member |
|
|
Sequences have number datatypes & number datatypes dont store numbers with trailing zero's. So probably something like
Select '000'||sequence.nextval
should help u.
To reset the sequence on 31-Dec, write a database trigger.
|
|
|