SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)
Creating an SQL/MX Database
HP NonStop SQL/MX Installation and Management Guide—523723-004
7-20
Managing Table Data
that has the NO CLEARONPURGE attribute, the system deallocates disk
space, but does not physically destroy the data in that disk space. This
approach improves the performance of the drop statement by reducing the
number of writes to the disk, but when that disk space is allocated to a new file,
other users might be able to read data left by the object that previously used
the space. CLEARONPURGE increases security for sensitive data by causing
the system to overwrite deallocated disk space when a table or index is
dropped.
•
Create tables from OSS files that you use as OBEY command files within MXCI.
Because CREATE TABLE statements can be very long, it is easier to correct errors
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 NonStop 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 NonStop 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.