SQL> CREATE TABLE myTable (
2 id INTEGER,
3 status VARCHAR2(20) DEFAULT 'Order placed' NOT NULL,
4 last_modified DATE DEFAULT SYSDATE
5 );
Table created.
SQL>
SQL> desc myTable;
Name Null? Type
-------------------
ID NUMBER(38)
STATUS NOT NULL VARCHAR2(20)
LAST_MODIFIED DATE
SQL>
SQL>
SQL> ALTER TABLE myTable
2 MODIFY last_modified DEFAULT SYSDATE - 1;
Table altered.
SQL>
SQL> desc myTable;
Name Null? Type
--------------------
ID NUMBER(38)
STATUS NOT NULL VARCHAR2(20)
LAST_MODIFIED DATE
SQL>
SQL> drop table myTable;
Table dropped.
SQL>
|