For a detailed explanation and examples refer to "SQL Reference Manual"
Abbreviated Syntax:
CREATE TABLE tablename
(columnname format [NULL|NOT NULL]...)
[WITH-Clause]
e.g. CREATE TABLE area
(town char(12) NOT NULL,
sales_area char(2));
NOTE: the default is NULL
Abbreviated Syntax:
CREATE [UNIQUE] INDEX indexname ON tablename
(columnname[ASC|DESC],
...);
Abbreviated Syntax:
MODIFY Tablename TO STORAGE-STRUCTURE
[UNIQUE] [ON Columnname [ASC|DESC],{Columnname [ASC|DESC]} [WITH
Clause]]
e.g. MODIFY Stock TO ISAM UNIQUE ON Product-Code, Branch-Code
There is a facility to 'Bulk load ' and 'Bulk unload' from files as long as the datatype/format is equivalent (i.e. for use in back-up copies):
COPY TABLE tablename() FROM|INTO 'filename';
Note: empty brackets() are only permissable when the Tables and data are identical in structure.
Abbreviated Syntax (when copying/loading selected columns from Table to Table):
COPY TABLE tablename ( col1 = type [WITH NULL], ...) FROM 'filename'; NOTE: You must use the WITH NULL clause when you have allowed NULLS in your TABLE structure;
e.g. to load from the file 'areadump' into the TABLE Area:
COPY TABLE area (town = char(12), sales_area = char(2) WITH NULL ) FROM 'areadump';
This WWW material is copyright De Montfort University and may only be reproduced or used if this copyright notice is included.