Skip to content

DF_DATABASE_DEFAULT_MAP_DF_TO_SQL_TYPE_SCHEMA

Determines for all DataFlex data types, which SQL native types will be used when creating new columns.

Map schemas can only be used with the DataFlex SQL Driver. There are map schemas for different SQL Server versions. Each map schema will use the SQL native types that are available and recommended for a specific SQL Server version.

Level

Database

Supported by

DataFlex SQL Driver revision 6 and higher.

Type

Integer, temporary

Access

Read/Write

Values

  • MAP_DF_TO_SQL_TYPE_SQL2000
  • MAP_DF_TO_SQL_TYPE_SQL2005
  • MAP_DF_TO_SQL_TYPE_SQL2008
  • MAP_DF_TO_SQL_TYPE_SQL2012
  • MAP_DF_TO_SQL_TYPE_UNICODE

Syntax

Use cli.pkg
Get_Attribute DF_DATABASE_DEFAULT_MAP_DF_TO_SQL_TYPE_SCHEMA of {driverNumber} {databaseHandle} to {IntegerVariable}
Set_Attribute DF_DATABASE_DEFAULT_MAP_DF_TO_SQL_TYPE_SCHEMA of {driverNumber} {databaseHandle} ;
to {MAP_DF_TO_SQL_TYPE_SQL2000|MAP_DF_TO_SQL_TYPE_SQL2005|MAP_DF_TO_SQL_TYPE_SQL2008|MAP_DF_TO_SQL_TYPE_SQL2012}

Driver Configuration Keyword

DEFAULT_MAP_DF_TO_SQL_TYPE_SCHEMA

Remarks

For SQL Server, the following default map schemas can be used:

MAP_DF_TO_SQL_TYPE_SQL2000
MAP_DF_TO_SQL_TYPE_SQL2005
MAP_DF_TO_SQL_TYPE_SQL2008
MAP_DF_TO_SQL_TYPE_SQL2012
MAP_DF_TO_SQL_TYPE_UNICODE

The following table shows per map schema, which SQL Server native types will be created when a new DataFlex column is created.

DataFlex Type SQL2000 SQL2005 SQL2008 SQL2012 UNICODE
DF_ASCII Char Char Char Char nVarchar
DF_DATE Datetime Datetime Date Date Date
DF_DATETIME Datetime Datetime Datetime2 Datetime2 Datetime2
DF_TEXT Text Varchar(max) Varchar(max) Varchar(max) nVarchar(max)
DF_BINARY Binary/image Varbinary(max) Varbinary(max) Varbinary(max) nVarbinary(max)

Type mappings will only be used when creating new columns. Existing columns will keep their existing SQL native data type during restructure. To change the native type of an existing column, use DF_FIELD_NATIVE_TYPE.

The schema types can be overwritten per type with the DF_DRIVER_MAP_DF<DATATYPE>_TO_SQLTYPE attributes, like DF_DRIVER_MAP_DFDATETIME_TO_SQLTYPE.

It is recommended to choose the mapping schema that matches the SQL Server version you are developing for.

If no default mapping schema is specified, the MAP_DF_TO_SQL_TYPE_UNICODE mapping schema will be used.

See the Type Mappings topic and Driver Attributes for more information.