You mean giving a record a unique identifier? Use a sequence (in this example for <col_id>): create sequence <seq_name> increment by 1 start with 1;
when you insert: insert into <table_name> (<col1>,...,<col_id>)
values (val1,...,<seq_name>.nextval))
If you need to reference the just by nextval created value use <seq_name>.currval.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.