Download Informix Guide to SQL: Syntax

Transcript
ALTER TABLE
Literal Terms
You can designate literal terms as default values. Use a literal term to define
alpha or numeric constant characters. To use a literal term as a default value,
you must adhere to the rules in the following table.
Use a Literal
With Columns of Data Type
INTEGER
INTEGER, SMALLINT, DECIMAL, MONEY, FLOAT,
SMALLFLOAT
DECIMAL
DECIMAL, MONEY, FLOAT, SMALLFLOAT
CHARACTER
CHAR, NCHAR, NVARCHAR, VARCHAR, DATE
INTERVAL
INTERVAL
DATETIME
DATETIME
Characters must be enclosed in quotation marks. Date literals must be
formatted in accordance with the DBDATE environment variable. When
DBDATE is not set, the format mm/dd/yyyy is assumed.
For information on using a literal INTERVAL, see the Literal INTERVAL
segment on page 1-749. For more information on using a literal DATETIME,
see the Literal DATETIME segment on page 1-746.
Data-Type Requirements
The following table indicates the data type requirements for columns that
specify the CURRENT, DBSERVERNAME, SITENAME, TODAY, or USER
functions as the default value.
Function Name
Data Type Requirements
CURRENT
DATETIME column with matching qualifier
DBSERVERNAME
CHAR, NCHAR, VARCHAR, or NVARCHAR column at least
18 characters long
(1 of 2)
1-52
Informix Guide to SQL: Syntax