f2s_convert_dat_structure

Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers

Syntax

f2s_convert_dat_structure {FileNumber} [{options} {table}]

Parameter

Description

FileNumber

The Dataflex filelist number (Filename.File_Number).

options

f2s_STRUCTEND_OPT_FORCE_NOT_NULL - This option set all of the field properties NOT NULL

f2s_STRUCTEND_OPT_CREATE_ROWID_TABLE - This option will use RowID rather than RECNUM

table

Name of table to use instead of physical name (optional)

Description

This command is used to create a SQL table from a .DAT file. It will create the structure but will not copy the data.

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 (see Convert Dat to Table). 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.

To copy the data, use f2s_copy_data command after the table has been created.

Example

     String sPhysicalFileName
     Integer iFileNumber

     // dataflex filelist number
     Move 52 to iFileNumber

     f2s_convert_dat_structure iFileNumber
Example with options
     String sPhysicalFileName
     Integer iFileNumber

     // dataflex filelist number
     Move 52 to iFileNumber

     //create a table "AddressValidation"
     f2s_convert_dat_structure iFileNumber f2s_STRUCTEND_OPT_FORCE_NOT_NULL "AddressValidation"

Replaces

CREATE_TABLE_FROM_DAT_FILE