Omitting the Column List

You may omit the column list when supplying values for every column:


SQL> CREATE TABLE EMP (EMPNO NUMBER(4) NOT NULL,
  2                    ENAME VARCHAR2(10),
  3                    JOB VARCHAR2(9),
  4                    SAL NUMBER(7, 2),
  5                    DEPTNO NUMBER(2));

Table created.

SQL>
SQL> INSERT INTO EMP VALUES (1, 'SMITH', 'CLERK',     800,    20);

1 row created.

SQL>

When you omit the column list, the order of the values you supply must match the order of the columns as listed in the output from the DESCRIBE command.

Home »
Oracle »
Table » 

Insert:
  1. Adding Rows Using the INSERT Statement
  2. Omitting the Column List
  3. Specifying a Null Value for a Column
  4. Single and Double Quotes and INSERT
  5. Copying Rows from One Table to Another with INSERT
Related: