Mertech’s new Lazy Open mode feature is designed to improve an application’s initialization performance by deferring table setup. Lazy Open mode delays the setup of table metadata (table, columns, indexes description) in memory until a field is accessed, even if an OPEN command is issued.
Archive for the ‘Flex2SQL’ Category
New Feature: Lazy Open Mode
Tuesday, September 20th, 2011Custom OEM to ANSI Translation
Monday, August 29th, 2011Mertech’s drivers have a standard OEM to translation based on the Windows API. When this feature is enabled, data sent to the SQL database is translated from the OEM to ANSI Character set and from ANSI to OEM before the data is sent back to the application.
The new version 11 drivers have a new feature available that allows the user to customize the mapping value for the OEM to ANSI translation. Basically the user can customize the OEM and the ANSI Character Translation using a macro command or through the mertech.ini file entry. The difference between these two approaches it is that the macro command must be added to each application, which means that some code has to be added and then the application source code has to be recompiled. But on the other hand, the use of the mertech.ini introduces the use of the Custom OEM to ANSI Character Translation automatically when the INI file is read during the driver initialization.
CL2SQL: Command Line Tool for Unattended Migration
Wednesday, January 20th, 2010Mertech provides a command line tool to allow migration of data using Flex2SQL features without the GUI interface. The tool, called cl2SQL, is located in the Mertech\bin directory and supports all the options of Flex2SQL through command line parameters.
A good use of this tool would be to convert an existing DataFlex databases to SQL without any attendants. Cl2SQL can be used along with the CONVER_DAT (see http://blog.flex2sql.com/index.php/2009/02/write-your-own-migration-routines-using-the-convert_dat_file-macro/) command to develop unattended migration process.
To see all the options supported by CL2SQL, click on cl2SQL to run it and an information window will be displayed with all the options. These options are listed below:
-?,-h,-help : This information screen.
-d <drv>, : Use driver <drv> where drv is one of our supported drivers.
-driver <drv> Such as ORA_DRV, MDS_DB2, SQL_DRV, MDSMYSQL and MDSPGSQL.
-f <fs>, : The fileset passed as a parameter in <fs> on which you
-fileset <fs> want to operate.
-file <n> : The filenumber passed as a parameter in <n> on which you
want to operate. You can only use this option with a fileset
This allows you to override the set of files on which you
want to operate with another file.
-prefix <ABC>, : The prefix <ABC> and postfix <ABC> options are to be used
-postfix <ABC>, for the tablename prefix or postfix as an override on what is
defined in the fileset.
You can only use this option along with a fileset.
-s <server>, : Database <server> to connect to, where <server> can be either
-server <server> the server name or IP used.
-database <db> : If you want to use another database as is specified in the
configuration file, then you can override the setting with
the value in <db>.
-u <user>, : User id to login with.
-user <user> You should not set this when you want to login using
a trusted connection.
-p <pass>, : Password to use for logging in.
-password <pass>
-port <n> : Use an alternative port to connect to on the database server.
-c <cfg>,-config <cfg>: Use the provided configuration in <cfg> file
-l,-login : Automatically log in using the last used/saved parameters.
This is the default behaviour if no login details are passed.
-r <rpt>,-report <rpt>: Write a migration report to file <rpt>.
-rc,-rptclear : Erase migration report file <rpt> (from the -report option).
before the actual report is being written hereby opening the
ability to not append to an existing report and start fresh.
Accessing existing non-DF tables, synonyms or views in DataFlex
Thursday, February 26th, 2009There are two ways to do this: (1) by using INTERMEDIATE FILES and (2) by changing the root name of the Filelist entry to Universal Naming Convention (UNC) syntax.
Using Intermediate Files (recommended)
Flex2SQL provides an easy way to generate .INT, .FD and .TAG files from an existing table or view:
Using Flex2SQL, login to the database backend (if you are not already logged on).
Select Generate | .INT File from Table/View/Synonym from the menu. This will bring up a list of all the tables/view/synonyms that exist on the server (Figure: 10.1).
Select the tables you want to generate the intermediate file for and press OK. The .INT and .TD files will be generated and added to your Filelist with the driver prefix (SQL_DRV: or ORA_DRV:).
In order to generate the .FD and .TAG file, check the appropriate options in the “.INT File From Table Grouping” dialog to enable the file generations in Filelist | Options.
Without Using Intermediate Files
To access an existing table without generating an intermediate file, a new entry must be added in the Filelist with the root name obeying the UNC convention.
ora_drv:\\servername\schemaname*tablename
Where SCHEMA Name is same as the creator of the table.
Now an open TABLE_NAME command will use the table on the Oracle server.
Following our login example, to open a table called EMP created by user SCOTT (also called schema name) on an Oracle server, we will have the following entry:
ora_drv:\\servername\scott*emp
Where “*” (asterisk or star) is used to distinguish between schema name and table name.
Since the calls to retrieve index information from the database system are resource intensive, you might notice a slower opening of files compared to using .INT file method.
In the case of MS SQL Server, you also need to specify the database name sql_drv:\\server name\databasename*schemaname*tablename.
Steps to Access Existing Tables Using VDF
- Open Flex2SQL and select Generate | .INT File from Table/View/Synonym.
- Select a table or view, and press OK. In the “Convert DAT to Table” dialog, change the available options as needed.
- When prompted, select a Filelist slot for the file.
- Open DBBuilder and select the file. Make sure it has the driver prefix before it.
- The Mertech “Login” dialog pops-up. Enter the login information. After login, DBBuilder shows the file structure information.
- Generate the Data Dictionary files (.DD files) for the table.
- Open VDF IDE and generate a view with the view wizard using the .DD generated in the previous step.
You are ready to compile and run your DataFlex program.
Using the COPY_DATA Feature With Flex2SQL
Friday, February 13th, 2009The COPY_DATA feature allows the user to copy data from an SQL table to a DAT file and vice versa.
Flex2SQL has two options that allows us to copy the data from a DAT to a SQL and vice versa, but our customers prefer a single command approach.
