Progress
Embedded SQL-92
Guide and Reference
CREATE TABLE
The CREATE TABLE statement allows you to create a new table in an existing database by defining its column names and column data types. You specify the table name for the table you are creating. Optionally, a CREATE TABLE statement can include table and column constraints.
EXAMPLEThe following code fragment illustrates a CREATE TABLE statement in an ESQL program. The cust_no column has the column constraint NOT NULL, which indicates that no row in the customer table is to have a NULL value in the cust_no column:
The CREATE TABLE statement also allows you to specify the DEFAULT clause along with a column definition. The DEFAULT clause identifies the default value to be used for a column, if you do not supply a value for that column in an INSERT statement.
EXAMPLEThe following CREATE TABLE statement shows how to use the DEFAULT clause. This example sets a default value of 10 for the deptno column:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |