Constants

The specification rules for literal constant values for the data types described above are given below. Most of these constants are formed in the usual ways. Each section below gives the syntax specification for constants of the specified data type followed by some examples. All of the examples refer to the following table definition.

create table mytypes(
    myrid       rowid primary key,
    myguid      guid,
    myname      char(24),
    mydescr     varchar(255),
    mydob       date,
    mylunch     time,	
    mylastchg   timestamp,
    myage       tinyint,
    mybooks     smallint,
    mygadgets   integer,
    mymolecules bigint,
    mysalary    decimal(8,2),
    mytaxrate   double,
    is_smart    boolean,
    is_married  boolean,
    myseckey    binary(10)
);
constant:
               boolean
       |       integer
       |       decimal
       |       float
       |       string
       |       binary
       |       date
       |       time
       |       timetz
       |       timestamp
       |       timestamptz
       |       guid
       |       NULL

ROWID

A ROWID constant is formed the same as an integer constant except that it is always > 0.

select * from mytypes where myrid = 243;

CHAR

The RDM SQL character types include CHAR and VARCHAR. ASCII (UTF-8) string constants are formed by enclosing the characters in the string inside single quotation marks ('string'). To include a backslash character in the string, enter a double backslash (\\). Strings in RDM SQL are stored as standard null-terminated UTF-8 strings.

'This is an ASCII/UTF-8 string constant'
'This string contains \'quotation\' marks'
'This string also contains "quotation" marks'
'This string contains one backslash (\\)'
'This string contains two backslashes (\\\\)'