Home » SQL & PL/SQL » SQL & PL/SQL » Complex sequence
Complex sequence [message #2808] Wed, 14 August 2002 07:12 Go to next message
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 Go to previous message
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.
Previous Topic: inserting value into varchar2 data type that contains new line
Next Topic: clob and blob (PLZ HELP ME AS SOON AS POSSIBLE)
Goto Forum:
  


Current Time: Fri Apr 26 17:45:50 CDT 2024