![Free-eBooks.net](/resources/img/logo-nfe.png)
![All New Design](/resources/img/allnew.png)
15 – HOW TO CREATE SEQUENCE
One can assign unique numbers , such as record-id, to columns in any data table by using a sequence, For this purpose, one need not have separate table and code to keep track of unique numbers Just another obJect like table, SEQUENCE obJect will serve our purpose, One could have seen the row number in excel 1 spreadsheet file can be equated with sequence,
As you are aware "create" command is used for creating obJects, the same can be used for creating another obJect "sequence" as we did earlier for table,
"create sequence <<user_given_sequence_name>>
increment by 1 start with 1000"
In a nutshell A sequence is the database obJect used to generate UNIQUE INTEGERS for use as PRIMARY KEYS,
This sequence number will be used in the table where the column declared for its uniqueness, For example, we create RecordId sequence using the command as