Contents Index Using column defaults Modifying and deleting column defaults

ASA SQL User's Guide
  Ensuring Data Integrity
    Using column defaults

Creating column defaults


You can use the CREATE TABLE statement to create column defaults at the time a table is created, or the ALTER TABLE statement to add column defaults at a later time.

Example 

The following statement adds a condition to an existing column named id in the sales_order table, so that it automatically increments (unless a client application specifies a value):

ALTER TABLE sales_order
MODIFY id DEFAULT AUTOINCREMENT

Each of the other default values is specified in a similar manner. For more information, see ALTER TABLE statement and CREATE TABLE statement.


Contents Index Using column defaults Modifying and deleting column defaults