Quick Start Guide

Overview

Flex2SQL Unicode Edition is made up of two basic components:

  • A migration utility that takes your existing DataFlex tables and indexes and migrates them to your target SQL backend

  • Database drivers that work with the DataFlex runtime and handle all client/server connection and database operations

This Quick Start Guide is intended to get you started by walking you through the migration of a small Dataflex Filelist.

Supported Platforms and DataFlex Versions

Flex2SQL Unicode Edition supports DataFlex v20+ running on Windows 10+. The following table shows the availability of Mertech drivers on various platforms.

Database

Supported Database Versions

Required Components

Oracle

12c – 21c including Express, Cloud, Standard, Enterprise

Oracle SQL*Net client Oracle Instant Client Recommended

MS SQL

2012 - 2019, (including Azure and LocalDB) including LocalDB, Express, Standard, Azure, and Enterprise Editions

MSOLEDB Native Client

Installation and licensing

The Flex2SQL Unicode Edition Setup Wizard guides you through the installation process. Follow the prompts, to accept the software license agreement, to select where the drivers are installed (C:Program FilesMertech Data SystemsFlex2SQLbin by default).

If you are evaluating the product, a limited license is installed. If you want to request a fully functional license file, contact Mertech Data Systems.

A Sample Migration

The example below uses files from the DataFlex Order Entry example to create matching tables and indexes on Microsoft SQL Server and then copies the data to the newly created tables. The procedure consists of logging into the target database, choosing the files to be converted, and then running the Convert Database command.

Login to the Target Database

  1. Select the Flex2SQL Utility shortcut from the Windows Start menu.

  2. Select the desired driver from the drop-down list.

Note: PostgreSQL users, if the PostgreSQL server does not have ciText support enabled a message displays to explain how-to enable this feature.

Note: Oracle users select the Help button and print instructions in the License Count View for ORAFlex topic. License control scripts must be run before performing a migration.

  1. Type the name of the server you are logging into and the user name and password for this session.

Note: MS SQL users can omit the user name and password and select Trusted Connection to rely on Windows Authentication.

v17/Unicode Edition/Quick Start Guide/media/image1.png
  1. Click Connect to log into the server.

  2. If you logged into PostgreSQL, MS SQL Server, or MySQL, select the target database from the Select Database dialog box.

Choose the files to be converted

  1. Select File | Open | Select Workspace from the menu bar.

  2. Choose the desired VDF version (18 in the example below) and Workspace (Order Entry Example in the example below) and then click Select.

  3. Click Select All to choose all the DataFlex files in the filelist for conversion. You can also use Ctrl+click to select individual file(s).

v17/Unicode Edition/Quick Start Guide/media/image2.png

Note: Do not include the FlexErrs, CodeType, and CodeMast DataFlex tables in the migration. These files are only used by DataFlex and are never required in the SQL database.

Run the Convert Database command

  1. Click Convert Database.

  2. Change the default migration preferences if required.

  3. Choose Create Tables & Indexes and Migrate Data, and then click Convert All.

v17/Unicode Edition/Quick Start Guide/media/image3.png
  1. Review the Migration Report (Reports |Migration Report) when the conversion is complete. The Migration Report displays any errors that may have occurred during the migration.

What happens during the migration?

The Flex2SQL Utility converts the selected files to the target database, adds a driver prefix (for example, f2s_ms) to the root file name entry in filelist.cfg and generates an intermediate file for each converted file (for example, Users.INT). Examine the Filelist dialog box after the conversion is complete. Notice that the selected files names have a driver prefix.

v17/Unicode Edition/Quick Start Guide/media/image4.png

When an open command is issued for a file containing a driver prefix, the DataFlex runtime passes the open operation to the Mertech driver associated with the file. The driver uses information in the INT file to connect to and open the converted SQL table.

Running your program

After all the files are converted to the target database, the next step is to add the appropriate login command to your program. This is the only change that is required. There are three ways to do this:

  • Mertech provides an automatic login dialog box that pops up if you are trying to open a converted file and you are not logged into the SQL database. This option is useful for testing.

  • Add login code to your program (for example): Login “(localdb)v11.0” “” “” “SQL_DRV”

  • Hard code the login details (SERVER_NAME, SCHEMA_NAME, and DATABASE_NAME) in the INT file. This can be done by setting options in the Tools | Preferences |Login tab before migration.

v17/Unicode Edition/Quick Start Guide/media/image5.png

What next?

The Flex2SQL Utility offers much more than the basic migration shown in this example. With the Flex2SQL Utility you can:

  • Create scripts to be used for high-speed data migration using native tools like SQL*Loader and Bulk Copy

  • Create scripts to commit changes directly to the backend or to generate DataFlex restructure code for distribution to remote sites

  • Browse both DataFlex and SQL data

  • Create and modify tables and indexes on the backend

  • Transfer DataFlex relationships to the server backend or to retrieve relationship information from the server into the .INT files

  • Use the multi-directory file handling option to create files with the same name in the backend database

The Flex2SQL product also includes commands developed by Mertech to allow you to optimize your programs for faster data access. Mertech’s embedded SQL statements or stored procedure calls can be used for procedures that manipulate a large number of tables and data so most of the processing is completed on fast servers and very little data transfer takes place between the server and the client. These commands along with many custom attributes are in the f2s.pkg package.