SQL/MX 3.1 Installation and Management Guide (H06.23+, J06.12+)
Creating an SQL/MX Database
HP NonStop SQL/MX Release 3.1 Installation and Management Guide—663852-001
7-22
Managing Table Data
in an OSS file than interactively in MXCI. Optionally, do a SHOWDDL and send the
results to an OSS file.
Consider creating dependent objects at the same time you create a table. To
simplify these operations, put all statements (such as CREATE TABLE, CREATE
VIEW, and CREATE INDEX) in the same OSS OBEY command file. Alternately,
you can incorporate these create statements into the CREATE SCHEMA
statement.
Use the LIKE option in the CREATE TABLE statement to create a table like the
existing table, source-table. This approach omits constraints (with the
exception of the NOT NULL and PRIMARY KEY NOT DROPPABLE constraints),
headings, and partitions unless include-option clauses are specified.
Optionally, create the new table with the same constraints and headings as the
source table. Alternately, override these attributes and create the new table with
different constraints and headings.
When you use the CREATE TABLE statement, for SQL/MX tables, note that it does
not provide the SIMILARITY CHECK clause used with SQL/MP because similarity
checking is always on for NonStop SQL/MX.
For more information about the CREATE TABLE statement, see the SQL/MX
Reference Manual.
For information about CREATE TABLE attributes for SQL/MP that are not supported by
NonStop SQL/MX, see the SQL/MX Comparison Guide for SQL/MP Users.
Managing Table Data
Defining Table Columns
To ensure the validity of your database, you must first define columns correctly for the
use of the data and assign data types that provide the best design for your application.
It is the database administrator’s task to consider how the data is used and to assign
appropriate data types and constraints.
When you define a column, you specify the column name, data type, and, optionally,
other column attributes. To define columns for a table, you can specify the column
definitions in the CREATE TABLE statement or in the ALTER TABLE with the ADD
COLUMN clause. However, HP recommends that you avoid using the ALTER TABLE
with the ADD clause if possible insofar as table performance is degraded by adding
columns.
Specifying Column Names
A column name is an SQL identifier that can be up to 128 characters in length. The
column name must begin with a letter unless it is delimited by double quotes. It
must be unique among column names. It cannot be a reserved word unless it is
delimited by double quotes. Regular SQL identifiers are not case-sensitive but










