SQLines Data Tool - Configuration File Reference

You can run SQLines Data tool from a command line, and this article describes the configuration file options. Additionally, you can specify options in Command Line.

The default configuration file is sqldata.cfg located in the current directory. You can use -cfg command line option to specify another location and file name for the configuration file.

All configuration file options can be specified in the command line as well.

Note. Please see sqldata.cfg supplied with the tool to see the full list of available options.

DDL Options

DDL (schema) migration options.

-ddl_tables

When -ddl_tables=yes the tool executes DDL statements defined by -topt command line option (CREATE; DROP and CREATE TABLE, or TRUNCATE TABLE statements). When no is specified the tool does not perform any DROP, CREATE, TRUNCATE statements for tables.

Default is yes.

-constraints

When -constraints=yes the tool migrates table constrains (primary and unique keys, check constraints, foreign keys).

Default is yes. It is possible to set -ddl_tables=no and -constraints=yes to migrate constraints only for existing tables.

-indexes

When -indexes=yes the tool migrates table indexes. Note that some indexes are defined by constraints (like primary or unique keys) and they will not be migrated by this option.

Default is yes. It is possible to set -ddl_tables=no and -indexes=yes to migrate indexes only for existing tables.

-object_name_case

When -object_name_case=lower the tool converts object names (tables i.e.) to lower case in all generated and executed DDL statements. When -object_name_case=upper the conversion to upper case is performed.

By default the object names case of the source database is used.

-column_name_case

When -column_name_case=lower the tool converts column names to lower case in all generated and executed DDL statements. When -column_name_case=upper the conversion to upper case is performed.

By default the column names case of the source database is used.

-column_name_quotes

Set characters to quote column identifiers in SQL scripts. For example, specify ”” for double quotes (or \”\” if you use the option in command line).

-object_name_quotes

Set characters to quote object identifiers (schemas, table etc). For example, specify ”” for double quotes (or \”\” if you use the option in command line).

-char_to_varchar_length

Define the start length for CHAR(n) columns to be converted to VARCHAR(n). For example, if -char_to_varchar_length=255 then all CHAR columns with the length equal or exceeding 255 are converted to VARCHAR.

You can use this option to solve "Table exceeds the maximum allowable table row size of 8060 bytes" errors when migrating to SQL Server.

-identity_start

Set the start value for IDENTITY (AUTO_INCREMENT) columns. By default, the start value is taken as the next value for the corresponding source table.

Data Options

Data transfer options.

-fetch_lob_as_varchar

When SQLines Data transfers LOB values it uses LOB API functions to read and write LOB data in parts as the maximum size of a LOB column in the table is unknown. Using LOB API functions significantly reduces the transfer performance even if the actual data in LOB columns do not have large size (i.e. 10-30 KB).

When you set -fetch_lob_as_varchar=yes, SQLines Data still creates LOB columns in the target database, but transfers data as regular VARCHAR columns without using LOB API. This can increase performance by 3x - 10x.

Set this option only if you know that the data in LOB columns do not exceed 32,700 bytes, otherwise a data truncation error raises.

The default value is no that means LOB API is used to transfer LOB data.

MySQL Options

Options applied when MySQL is the source or target database.

-mysql_set_foreign_key_checks

When a value is set for the -mysql_set_foreign_key_check option, each session executes the following statement after establishing the connection:

  SET FOREIGN_KEY_CHECKS=value

If -mysql_set_foreign_key_check=0 is set, each session executes SET FOREIGN_KEY_CHECKS=0 that

  • Allows creating a foreign key constraint even if the parent table does not exist
  • Does not check key values when a foreign key is created

This can significantly increase the migration performance as MySQL requires significant time (often much more than data transfer time) to check foreign keys, but inconsistent data can be loaded into tables that can violate referential constraints.

SQL Server Options

Options applied when Microsoft SQL Server is the source or target database.

-sql_unicode_char

When exporting data from a SQL Server database, use Unicode for CHAR and VARCHAR columns, default is yes.

If no is specified, the tool will use the database collation, but note that even if the database collation includes _UTF8 in its name the data may be still converted to single-byte client locale, so you can see '???' characters.

PostgreSQL Options

Options applied when PostgreSQL is the source or target database.

-pg_zero_char_replace

PostgreSQL does now allow characters with zero code in character (non-binary) data types (CHAR, VARCHAR and TEXT). See Zero character code in CHAR or VARCHAR for more details.

If the source value is a string (non-binary) -pg_zero_char_replace option specifies the replacement character (decimal ASCII code) i.e 32 for a blank. Use an empty value to prevent any replacement and leave the zero characters as is.

Informix Options

Options applied when Informix is the source database.

-informix_client_locale

Informix ODBC driver ignores CLIENT_LOCALE options set in SETNET32 and environment variables, so you have to set the -informix_client_locale option to specify which client locale to use for the connection to Informix.

If you do not set option, and the database locale and your default client locale is difference, you can get conversion errors:

21005 [Informix][Informix ODBC Driver]Inexact character conversion during translation.

Example:

  -- CLIENT_LOCALE=en_US.819 will be set for the connection
  -informix_client_locale=en_US.819