ADD COLUMN
To add columns to an existing table, use the ADD
COLUMN
setting with the ALTER TABLE
command.
In this command, the syntax for adding columns is as follows:
ADD [COLUMN] column_name data_type [ NODEFAULT | NOMODIFY | HIDDEN ]
When you add columns, you must specify the column name and data type. You can also specify optional properties.
You cannot add primary keys to an existing table.
When a new column is added to the
table using the NODEFAULT
clause, any INSERT statements
that are sent from the probes or gateways fail. The failure occurs
because they do not comply with the NODEFAULT
constraint.
When you mark a column as NODEFAULT
and a row is inserted into that table, the
insert statement must explicitly set a value for that column or the INSERT statement becomes
invalid.
This occurs because the INSERT statement will not attempt to populate the
NODEFAULT
column. The trigger will also be invalid and cannot be successfully
recompiled.