Chapter 9 SQL Statements
471
Columns declared with DEFAULT TIMESTAMP contain unique
values, so that applications can detect near-simultaneous updates to
the same row. If the current timestamp value is the same as the last
value, it is incremented by the value of the
DEFAULT_TIMESTAMP_INCREMENT option.
$ For more information, see
"DEFAULT_TIMESTAMP_INCREMENT option" on page 183.
You can automatically truncate timestamp values in Adaptive
Server Anywhere based on the
DEFAULT_TIMESTAMP_INCREMENT option. This is useful for
maintaining compatibility with other database software which
records less precise timestamp values.
$ For more information, see
"TRUNCATE_TIMESTAMP_VALUES option" on page 215.
The global variable @@dbts returns a TIMESTAMP value
representing the last value generated for a column using DEFAULT
TIMESTAMP. For more information, see "Global variables" on
page 252.
♦
string For more information, see "Strings" on page 224.
♦
global-variable For more information, see "Global variables" on
page 252.
♦
column-constraint A column constraint restricts the values the
column can hold.
table-constraint A table constraint restricts the values that one or more
columns in the table can hold.
Constraints Column and table constraints help ensure the integrity of data
in the database. If a statement would cause a violation of a constraint,
execution of the statement does not complete, any changes made by the
statement before error detection are undone, and an error is reported. Column
constraints are abbreviations for the corresponding table constraints.
For example, the following statements are equivalent:
CREATE TABLE Product (
product_num integer UNIQUE
)
CREATE TABLE Product (
product_num integer,
UNIQUE ( product_num )
)