Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 

 

 

 

 

 

 

15 HOW TO CREATE SEQUENCE

One   ca assig unique   number 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 creat RecordI sequenc using  the  command  as