19 The Paradox Driver : Create Table Statement

Create Table Statement
The Create Table statement is used to create database files. The form of the Create Table statement is:
CREATE TABLE filename (col_definition[,col_definition,...])
filename can be a simple name or a full name. A simple file name is preferred for portability to other SQL data sources. If it is a simple file name, the file is created in the directory you specified as the database directory in the connection string. If you did not specify a database directory in the connection string, the file is created in the directory you specified as the database directory in the Registry. If you did not specify a database directory in either place, the file is created in the current working directory at the time you connected to the driver.
col_definition is the column name, followed by the data type, Default clause, followed by an optional column constraint definition. Values for column names are database specific. The data type specifies a column’s data type.
The only column constraint definition currently supported by some flat-file drivers is Not Null. Not all flat-file database files support Not Null columns. In the cases where Not Null is not supported, this restriction is ignored and the driver returns a warning if Not Null is specified for a column. The Not Null column constraint definition is allowed in the driver so that you can write a database-independent application (and not be concerned about the driver raising an error on a Create Table statement with a Not Null restriction).
A sample Create Table statement to create a Paradox database file named emp is:
CREATE TABLE emp (last_name CHAR(20) NOT NULL DEFAULT 'JOHNSON', first_name CHAR(12) NOT NULL,
salary NUMERIC (10,2) NOT NULL, hire_date DATE NOT NULL)