Other SAND CDBMS SQL Language Elements
SAND CDBMS supports a number of special constants that can be used anywhere a regular constant can appear. These special constants represent variable values, such as current user, connection name, schema, or date/time information.
The special constants are the following:
The current date (DATE data type format)
The current connection name (character string)
The current schema name (character string)
The current time (TIME data type format)
The current timestamp (TIMESTAMP data type format)
The current authorization identifier (character string)
The appearance of a space in the special constant indicates that any amount of whitespace may be used between the words in the constant. For instance, "CURRENT TIME" is equivalent to "CURRENT TIME".
CREATE TABLE invoice (iname VARCHAR(128),
idate DATE) ;
INSERT INTO invoice (iname, iamount, idate)
VALUES (USER, 12.99, CURRENT DATE);
In this example, the values inserted into the invoice table are the current user name (USER), a numeric amount (12.99), and the current date (CURRENT DATE). Note that the idate column must have been defined as DATE only, otherwise a data type mismatch error will be returned when attempting the INSERT.