CREATE TABLE

Use the CREATE TABLE command to create a table.

Syntax

CREATE TABLE [database_name.]table_name
PERSISTENT | VIRTUAL
(column_name data_type [ PRIMARY KEY | NODEFAULT | NOMODIFY | HIDDEN],...
[, PRIMARY KEY(column_name,...) ] );

The table name must be unique within the database and comply with the ObjectServer naming conventions.

The storage type is either PERSISTENT or VIRTUAL. A persistent table is re-created, complete with all its data, when the ObjectServer restarts. A virtual table is recreated with the same table description, but without any data, when the ObjectServer restarts.

When you define columns, you must specify the column name and data type, and can also specify optional properties.

The maximum number of columns in a table is 512, excluding the system-maintained columns. The maximum row size for a table, which is the sum of the length of the columns in the row, is 64 KB.

Example

create table mydb.mytab persistent
(col1 integer primary key, col2 varchar(20));