Indexes Tab

How To Access

  • Main Menu | Tools | Generate .INT | .INT File from .DAT, Indexes tab

If you wish to make the indexes on the migrated table different than the DataFlex table, use this tab to make those changes. They will be reflexed in the resulting .INT file. Please use caution when making changes in this tab, see the note below.

Note

Indexes on the target server are created based on the indexes in the DataFlex data file. These are also the default indexes on the server. Mertech recommends that you keep the indexes the same and make no changes during the first phase of data migration. Working with defaults and allowing Flex2SQL to handle data migration and index creation ensure proper and optimal functioning of the driver. Once you develop a familiarity with SQL databases and the Mertech drivers, you can make modifications in index structures to enhance performance.

CreateINT_IndexesTab.png

Primary Key

The Primary Key tab shows the index number in the DataFlex file and the fields that comprise the index and are used to create a primary key on the target server. By default, Index 1 is selected in a DataFlex file to be the primary key in the table, but the user can change this. For fast and efficient access, it is suggested that the primary key be comprised of columns that give maximum selectivity.

Flex2SQL selects the Inverse Key checkbox in the Primary Key tab and Native Index tab if one segment is DESC or C/S.

Primary Index

RECNUM is the primary index in a DataFlex file. Whenever you perform any operation using RECNUM, the RECNUM index (Index.0) is used. If you are using only the DataFlex database, there is no choice; RECNUM is the primary index. However, with other databases, you can specify any index as the primary index. In ORAFlex, RECNUM, by default, behaves just like the RECNUM field in DataFlex. However, the user can select another index to be the primary index. This is controlled during migration or can be changed after migration in the intermediate file by changing the PRIMARY_INDEX token to an index number specified in the intermediate file.

For ORAFlex, you can select an index created on a non-numeric field to be the primary index. But to make this work, you have to change the definition of the RECNUM field in your .FD file from a numeric to a string data type. For example, if you have a definition like:

#REPLACE VENDOR.RECNUM |FN21,0

In your .FD file, you will have to change this to:

#REPLACE VENDOR.RECNUM |FS21,0

Native Index

The Native Index tab allows you to control which indexes are created on the server. If you do not plan to change your DataFlex program, Mertech recommends that you use the default selections that are presented to you by Flex2SQL. The primary key is not selected because the primary key is always created.

Bottom Controls

The controls at the bottom of the dialog remain the same regardless of the tab selected.

The Buttons

  • Preferences: Shows the Preferences dialog.

  • SaveSet: Shows the Save the files to save as a set dialog.

  • Generate All: Generates the scripts for all the tables selected in Filelist dialog based on the radio button selected in What to do radio buttons.

  • Convert: Generates script for the only the table in the Table Name form based on the radio button selected in What to do radio buttons.

  • Help: Shows the help page of the selected tab.

  • Cancel: Closes the dialog.