CREATE_TABLE_FROM_DAT_FILE¶
Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex
This command is used to create a SQL table from a .DAT file. The table being copied must be not be opened in order for this command to work properly. This is the programmatic equivalent to using the Flex2SQL Migration Tool. Optional restructuring options can be specified here (see below) as well as an alternative table name than the physical name of the .DAT file. Note that this only creates the table structure, no data will be copied here. To copy the data, use COPY_DATA after the table has been created.
DF_STRUCTEND_OPT_FORCE_INVK - Deprecated
DF_STRUCTEND_OPT_OLD_INVK_NAME - Deprecated
DF_STRUCTEND_OPT_FORCE_NOT_NULL - forces all fields to be created as NOT NULL.
Syntax
CREATE_TABLE_FROM_DAT_FILE {FileNumber} [{options} {table}]
Parameter |
Description |
---|---|
FileNumber |
Number of the file |
options |
DF_STRUCTEND_OPT_FORCE_INVK DF_STRUCTEND_OPT_OLD_INVK_NAME DF_STRUCTEND_OPT_FORCE_NOT_NULL (optional) |
table |
name of table to use instead of physical name (optional) |
Example
Login "localhost" "user" "pass123" "sql_drv"
CREATE_TABLE_FROM_DAT_FILE Customer.File_Number "Customer"
COPY_DATA "Customer" to "sql_drv:Customer" CALLBACK (Callback(Self)) CONSTRAIN "STATUS = 'Active'"