Set a column back to the default using the DEFAULT keyword in an UPDATE statement.
SQL> CREATE TABLE myTable (
2 id INTEGER CONSTRAINT default_pk PRIMARY KEY,
3 status VARCHAR2(20) DEFAULT 'N/A' NOT NULL
4 );
Table created.
SQL>
SQL> INSERT INTO myTable VALUES (1,'asdf');
1 row created.
SQL>
SQL> select * from myTable;
ID STATUS
---------- --------------------
1 asdf
SQL>
SQL>
SQL> UPDATE myTable
2 SET status = DEFAULT;
1 row updated.
SQL>
SQL> select * from myTable;
ID STATUS
---------- --------------------
1 N/A
SQL>
Home »
Oracle »
Table »
Oracle »
Table »
Default_Value:
- Default value
- Set a column back to the default using the DEFAULT keyword in an UPDATE statement.
Related: