Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generate Sequence Value

Greetings Seniors & Experts, Hope you all are doing great. So, recently I've been practicing SQL.
This is the challenge that I'm facing currently. How can I code to generate the sequence automatically in SQL Command? Let's say I want to create a table named STUDENT, and I want to maintain the id which will be followed sequences 01, 02, 03 ... up to this point the code is,
CREATE TABLE TEST
(
ID NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1 MINVALUE 1 CACHE 20 CYCLE ORDER KEEP)
);
but what shall I need to for the STU_ID which I want it to follow the sequence like ID but additionally it will add 'STU_ID_00' ?
ID.png

This post has been answered by Frank Kulash on Sep 19 2022
Jump to Answer
Comments
Post Details
Added on Sep 19 2022
5 comments
657 views