Question : How to generate a unique number with current year concatenated with a sequential number?

I want to create a unique number taking the current year and concatenating it with a sequential number which resets back to 1 when the current year changes.  I know I can't do this within the SEQUENCE object type, and will have to use a function.  Any help would be appreciated.

Answer : How to generate a unique number with current year concatenated with a sequential number?

the function above does the same thing as to_char(sysdate,'yyyy') || your_sequence.nextval

except it returns the result as a number it you need that...

select to_number(to_char(sysdate,'yyyy') || your_sequence.nextval) from dual

you will still need the dbms_job to reset the sequence to 1 at the start of the year.
Random Solutions  
 
programming4us programming4us