NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-26
Examples—DEFAULT
You cannot specify NULL if you also specify the NOT NULL clause in the
command that creates the column.
Examples—DEFAULT
The following example shows a CREATE TABLE statement that uses DEFAULT
clauses to specify default values for three of the columns in the table:
CREATE TABLE ITEMS
(ITEM_ID CHAR(12) NO DEFAULT,
DESCRIPTION CHAR(50) DEFAULT NULL,
NUM_ON_HAND INTEGER DEFAULT 0 NOT NULL,
DATE_ADDED DATE DEFAULT CURRENT NOT NULL,
PRIMARY KEY ITEM_ID);
DEFINEs
A DEFINE is a named set of attribute-value pairs associated with a process. You can use
DEFINEs to pass information to a process when you start the process. DEFINEs are
often used to pass information about Guardian names.
NonStop SQL/MP allows you to use DEFINE names as logical names for tables, views,
indexes, partitions, catalogs, collations, or Guardian files in NonStop SQL/MP
statements. When SQL compiles such statements, it replaces the DEFINE name in the
statement with the Guardian name currently associated with the DEFINE.
A DEFINE name begins with an equal sign (=) followed by a letter and can contain 2 to
24 characters, including alphanumeric characters, hyphens (-), underscores (_), and
circumflexes (^). Uppercase and lowercase characters are considered equivalent in
DEFINE names.
These are reasons for using DEFINE names in SQL statements:
DEFINE names are easier to understand than Guardian names.
For example, the name =CUSTOMERS is simpler than an actual file name such as
\SYS1.$VOL2.SALES.CSTMERS.
DEFINE names provide location independence.
For example, if you code with DEFINE names, you can rename database objects,
move database objects, or change the database that a program accesses without
changing source code.
NonStop SQL/MP includes a set of DEFINEs that specify values for SQL operations.
These DEFINEs start with the characters “=_” and include the following:
=_AUDSERV_XSWAP_node
=_DEFAULTS