skip to main content
Input REST file syntax : Table definition entries : Data type mapping
  

Try DataDirect Drivers Now

Data type mapping

You can manually configure the mapping of data types to a column using the following syntax in a column definition.
"<column_name>":"<data_type>(<size_parameters>)",
column_name
is the name of the column in your relational table.
data_type
is the case-insensitive name of the data type to which you want to map the column. For columns for which no data type is defined, the driver heuristically maps the column to the most appropriate data type. If a value of null is specified, the column is mapped to the default data type, varchar(50). See the "Supported Data Types and Parameters" table for a list supported data types.
size_parameters
(optional) is the length, precision and/or scale of the specified data type. If this value is not specified, the driver will use the default value for the data type.
For example:
"price":"decimal(18.2)",
"name":"Varchar(256)",
"age":"Integer",
The following table documents the supported data types and parameters.
Table 33. Supported data types
Data Type and Parameters
Characteristics
BigInt
Range: -99*1018 to 99*1018
Binary(l)
Range: -99*1032765 to 99*1032765
Bit
Valid values: 0 or 1
Boolean
Valid values: 0 or 1
Char(l)
Precision: 255
Date
Range: -99*108 to 99*108
Decimal(p.s)
Range: -99*1014 to 99*1014
Minimum scale: 0
Maximum scale: 32767
Double
Range: -99*1051 to 99*1051
Float
Range: -99*1022 to 99*1022
GUID
Range: -99*10522 to 99*10522
Integer
Range: -99*108 to 99*108
JSON
Precision: 16777215
LongVarBinary(l)
Precision 16777215
LongVarChar(l)
Precision: 16777215
NVarChar(l)
Precision: 32767
SmallInt
Range: -99999 to 99999
Time(s)
Precision: 12
Minimum scale: 0
Maximum scale: 9
Timestamp(s)
Precision: 23
Minimum scale: 0
Maximum scale: 9
TinyInt
Range: -999 to 999
VarBinary(l)
Precision: 16777215
VarChar(l)
Precision: 32767