SQL/MP Installation and Management Guide
Creating a Database
HP NonStop SQL/MP Installation and Management Guide—523353-004
5-28
Defining Columns
•
A column used in nonunique index keys can contain null values because duplicate
values are allowed in such columns.
•
A column used as a unique key for a single-column index can contain null values,
but only one row with a null value is allowed. Therefore, you might want to define a
column used in this manner as NOT NULL.
Unique multicolumn indexes can contain columns with null values. The same rule
applies as for single-column unique indexes; that is, the index can have at most
one row of all null values in the columns. Null values are treated as all other values
and therefore cause duplication of rows in the same manner.
•
For partitioning an index, a null value is considered greater than other values and
equal to other instances of the null value. You can use the NULL indicator in the
FIRST KEY clause to group all rows with null values in the index key into the same
partition. In an index with an ascending key, all rows with null values in the key
column appear in the last partition; in an index with a descending key, all rows with
null values in the key column appear in the first partition.
Specifying Column Attributes
A column definition can specify the HEADING, HELP TEXT, and UPSHIFT attributes,
which can be used by programs and retrieved from the catalog description. These
descriptive column attributes are used automatically by applications generated through
the Pathmaker application development tool. To assist with application development
and integrity, the attributes can also be used by applications generated outside of the
Pathmaker environment.
HEADING Attribute
The HEADING attribute associates heading text with a column to enable applications
to refer to an alternate heading in place of the column name itself. A column can have
a default heading of up to 132 characters. Alternatively, if NO HEADING is specified for
the column, the application uses the column name as the default.
HELP TEXT Attribute
The HELP TEXT attribute associates help text with a column name to provide help
information. The help text is stored in the COMMENTS table, in order of entry, as
single rows of up to 77 characters each. You can retrieve the help text by querying the
COMMENTS table.
UPSHIFT Attribute
The UPSHIFT attribute is allowed for single-byte character-type columns only. If
UPSHIFT is specified, SQL/MP upshifts all data entered before storing the data in the
column.