If you want the values of a numeric column to automatically increment when you create a table, you can define an auto-increment column. In an Oracle tenant, you can use the SEQUENCE keyword in an INSERT statement to define an auto-increment column.
Examples
Create a table named
t1.obclient> CREATE TABLE t1 (id NUMBER PRIMARY KEY); Query OK, 0 rows affectedCreate a sequence named
s1.obclient> CREATE SEQUENCE s1; Query OK, 0 rows affectedInsert data into the
t1table.obclient> INSERT INTO t1 VALUES (s1.NEXTVAL), (s1.NEXTVAL); Query OK, 2 rows affected Records: 2 Duplicates: 0 Warnings: 0View data in the
t1table.obclient> SELECT * FROM t1; +------+ | ID | +------+ | 1 | | 2 | +------+ 2 rows in set