Oracle
DEFAULT option
Figo Kim
2006. 11. 13. 14:25
CREATE TABLE hire_dates
( id NUMBER(8),
hire_date DATE DEFAULT SYSDATE);
When you define a table, you can specify that a column be given a default value by using the DEFAULT option. This option prevents numm values from entering the columns if a row is inserted without a value for the column.
- Literal, expressions, or SQL functions are legal. ie) SYSDATE, USER
- A column name or a pseudocolumn are illegal. ie) NEXTVAL, CURRVAL
- Must match with column data type.