CONVERT_DAT_FILE¶

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

This command is the programmatic equivalent to the Flex2SQL Migration Tool. With this command, a SQL table can be created from a .DAT table. This combines the COPY_DATA and CREATE_TABLE_FROM_DAT_FILE, creating the table structure and copying all the data into the new table with one command. The table being converted cannot be opened and so a manual login is needed. Note that to specify the database to copy the table to, use SET_DATABASE_NAME. Below is a list of the optional restructure options to use when creating the table.

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

CONVERT_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"
CONVERT_DAT_FILE Customer.File_Number DF_STRUCTEND_OPT_FORCE_NOT_NULL "Customer"