Home > database >  Orcal how to create a specific serial number
Orcal how to create a specific serial number

Time:10-26

AAABBB constant
5 year of production
3 month of production
0001 serial number, a month to start from 0001
Constant C

The serial number of the combination is AAABBB530001C AAABBB530002C AAABBB530003C such increment

CodePudding user response:

Write their own functions

CodePudding user response:

Why can't his number?

CodePudding user response:

1, create sequence Student_stuId_Seq
The create sequence Student_stuId_Seq
Increment by 1
Start with 1
Minvalue 1
Maxvalue 9999;
2, the serial number
Select 'AAABBB' | | to_char (sysdate, 'y') | | extract (the month from sysdate) | |
The replace (lpad (Student_stuId_Seq. Nextval, 4), "', '0') | | 'C' from dual;
3, create a stored procedure, delete sequence at the beginning of every month and regenerate
Delete the sequence order
The drop sequence Student_stuId_Seq;

CodePudding user response:

I can check it on the pseudo list sequence, but how inserted into a specific data list, (I want to be a trigger, every time to insert to insert the data table and so increasing sequence), mainly is the stitching good sequence from pseudo table inside value is inserted into a table inside huh
  • Related