The Flex2SQL Utility

Refer to the Quick Start Guide for details on starting the program and logging into the target database server.

Toolbar

The toolbar contains icons that can be used instead of a menu command for commonly used functions. Hover the mouse over an icon to determine the icon’s function.

Toolbar.png

For example, instead of choosing Database | Select a Database from the menu bar, you can click the i_SelectADatabase Select a Database icon.

Toolbar icons are grouped by the function they perform. Right-click the toolbar to select which toolbar icons are visible.

Note

There are 2 buttons on the toolbar that do not have cooresponding menu items:

  • The Filelist button (i_FilelistBtn) shows the filelist dialog when the dialog has been closed. This button will be disabled when the filelist dialog is showing.

  • The Refresh Filelist button (i_RefreshFilelistBtn) refreshes the tables in the filelist dialog. Pressing F5 will also refresh the filelist. This does nothing if the filelist dialog is not showing.

Filelist dialog

The Filelist dialog box is used to select the files for the data conversion.

FilelistDialog.png

 

  • If you close the filelist, you can show it again using the Filelist button i_FilelistButton in the toolbar. When the filelist is showing, this button will be disabled.

  • Double-click a filelist entry to browse data in the file. Right-click the Filelist dialog box to see a popup menu with a list of available database commands.

Shortcut menu

A shortcut menu, that contains commands specific to the active filelist, can be displayed by clicking the right-mouse button in the Filelist dialog box.

Shortcut.png

 

  • Convert Database: Shows the Convert Dat to Table dialog.

  • Restructure Table: Shows the Restructure Table dialog.

  • Index Maintenance: Shows the Index Maintenance dialog.

  • Synchronize Relationships: Shows the Synchronize Relationships dialog.

  • Browse Data: Shows the Browse Data dialog. If you double click on the table, this dialog will show.

  • Drop Table(s): After confirming the action, it drops the selected table or tables from the SQL database and, if applicable, reverts the entry in the filelist to the corresponding DataFlex .DAT file.

  • Analyze Storage Requirements: Shows the Analyze Storage Requirements dialog.

  • Create Text File for MSSQL Loader: Shows the Create Text File for Loader dialog.

  • Adjust Sequence Definition: This option resets the Oracle sequence definition to start from the next available value in the sequence. This is required if your data was migrated with the Preserve Recnum Value option. Running this option, updates the Oracle sequence definition to start at 1 plus the highest RECNUM value in the DataFlex table.

  • Enable Trigger to Handle Inverse Key: Enables a trigger to automatically manage inverse keys whenever an insert, update, or deletion of a record takes place. Inverse key fields are additional fields created during data migration to handle indexes with descending index segments. These additional fields allow the driver to scan a set of data in descending order without issuing an order by clause. Inverse keys are also used to support upper case indexes.

  • Disable Trigger to Handle Inverse Key: Disables the trigger to handle inverse keys.

  • Select A Databse: Shows the Select A Database dialog.

  • Change Table Handler: Shows the Change Table Handler dialog.

  • Copy Data from .DAT to Table: Copies data from a DataFlex file to an existing table. Typically, this option is used to copy data to an empty table created using Flex2SQL.

  • Copy Data from table to .DAT file: Copies data into a DataFlex file from a table on the server. This is normally done on a blank data file.

  • Erase a DataFlex file: Uses the DataFlex zerofile command on the DataFlex file to remove all records from the file.

  • Erase a Table: Deletes all records from the selected table.

  • Edit Filelist item: Shows the Add/Edit a Filelist dialog.

  • Remove filelist item: Deletes the selected file from the filelist. The file/table itself is not deleted.

Note

Some menu items may be disabled for particular tables. Whether or not the menu item is enabled depends on the database server the table is using.

Side Buttons

  • Convert Database: Displays the Convert Dat to Table, where migration options are selected and the file conversion is initiated.

  • Add Driver Prefix: Adds the driver prefix (e.g., Sql_drv) to the root file name entry in the filelist. This effectively tells the DataFlex runtime to treat the file as a non-DataFlex file. When an open command is issued, the DataFlex runtime passes the open operation to the driver associated with the file. If you are using Select Files Without a filelist (File Menu) a popup will show informing you that you must have a filelist or workspace to use this option.

  • Remove Driver Prefix: When you remove the driver prefix, DataFlex runtime treats the file as a native DataFlex file. Using driver prefixes is a good way to switch between your DataFlex and newly migrated tables on the server. If you are using Select Files Without a filelist (File Menu) a popup will show informing you that you must have a filelist or workspace to use this option.

  • Select DF Files: Highlights all the files in the filelist that do not contain the driver prefix and for which the DAT file can be physically located by searching directories in DFPATH. See Also: Preferences - DFPATH Tab

  • Select Tables: Selects all entries in the filelist that have a valid corresponding table on the target server. The command may take a few seconds, depending on the number of files in the filelist, because the target server’s data dictionaries are used to verify the existence of these tables.

  • Select All: Selects all DF files and tables.

  • De-Select All: Deselects all highlighted entries.

  • Invert Select: Toggles the marked and unmarked entries. All marked entries are unmarked and all unmarked entries are marked.

Bottom of the dialog

  • Show Only Unique Root Names: Since DataFlex works with file numbers and not file names, two entries with the same name at a different filelist slot are considered two separate files. It is quite common to have files of the same name at different locations as alias files. If this option if checked, duplicate names are hidden. If the file has already been migrated it is not necessary to check this option.

  • Schema: Select the owner for the converted files from the pulldown list. The Schema Dropdown box will not be visible for MySQL/MariaDB or Oracle.

  • Migrate Non-DataFlex File: When this option is checked, Flex2SQL uses the appropriate driver to read data from the source file and perform the data migration. The most common usage is when you are migrating Pervasive.SQL files. You must have the driver for Pervasive installed in the Flex2SQL bin directory with the proper license registration.

  • .INT File Directory: Specify the location of the .INT files generated by the driver for Pervasive.SQL. Care must be taken not to over write these .INT files with the ones generated by Flex2SQL; otherwise, you cannot open the Btrieve files again. You must generate the Flex2SQL .INT files in a separate directory.