ImplicitSqlDatetimesAsDfDates

Applies to: Oracle, MS SQL, MySQL/MariaDB, PostgreSQL Drivers

Added in Flex2SQL 18.1.

An advanced mertech.ini compatibility option for applications that already rely on SQL datetime or timestamp columns being mapped to DataFlex dates.

Warning

Use this option only after consulting with Mertech Support.

Setting ImplicitSqlDatetimesAsDfDates = yes changes the default mapping for SQL datetime and timestamp columns that are not explicitly mapped in the INT file. They are treated as DataFlex dates, without the time component.

This also applies to columns added in the future. While this option is enabled, you lose the ability to add a datetime column and have it automatically treated as a DataFlex datetime. Every new column that must retain datetime behavior must be explicitly defined as a datetime in the table’s INT file. Adding the column with a SQL datetime type alone is insufficient.

Configuration

Set the option in the appropriate driver section of mertech.ini`: ``[MSSQL], [ORACLE], [PGSQL], or [MYSQL] (the MySQL/MariaDB configuration section).

The default is no. An omitted or empty setting uses the driver’s default.

[MSSQL]
ImplicitSqlDatetimesAsDfDates = no

Use yes only when the legacy behavior described above is required.

Value

Behavior

no (default)

Uses the driver’s normal SQL-to-DataFlex type mapping. This option does not force implicitly mapped datetime columns to dates.

yes

Maps SQL datetime/timestamp columns to DataFlex dates unless their datetime mapping is explicitly defined in the INT file. This applies to existing columns and newly added columns.

Effect on INT Files and New Columns

This setting controls the default DataFlex mapping; it does not change the SQL column’s declared type. A date mapping does not expose the time component as a DataFlex datetime.

For example, suppose you add a SQL datetime column named ProcessedAt and do not add an explicit datetime definition for it to the INT file. With this option enabled, Flex2SQL maps ProcessedAt as a date. To use both its date and time in DataFlex, explicitly define that field as a DataFlex datetime in the INT file.

The INT definition must identify the correct FIELD_NUMBER and specify the datetime FIELD_TYPE (the DataFlex DF_DATETIME type). An INT entry that only identifies the field, or only specifies unrelated field settings, does not establish its datetime type. See Understanding Mertech Files for the INT-file tokens and Table Restructuring for field-type handling.

Keep this requirement in your schema-update process for as long as the option remains enabled. It is intended to preserve a legacy application’s date-only behavior, not as a general setting for new applications.