SQL data types
- Last UpdatedJul 19, 2024
- 3 minute read
The SQLData object can create the following column types:
-
Boolean with size of 1
-
Integer with size of 2
-
Floats with size of 4
-
DateTime with size of 8
-
Timestamp with size of 8
-
String with size of 512
The following table indicates the column type created in the Microsoft SQL Server database based on the selection for the SQLData object column data type:
SQLData Object Column Data Type
SQL Database Column Data Type
SQL Database Column Size
Boolean
bit
1
DateTime
datetime
8
Floats
floats
4
Integer
int
2
String
char (512)
512
Timestamp
datetime
8
Microsoft SQL Server user defined datatypes are not supported as column datatypes by the SQLData object. For information on SQL Server data types, see the Microsoft SQL Server documentation.
For attribute data type conversion, the SQLData object only supports conversion of similar types of data. Some data type conversions are not supported. For example, a DateTime value cannot be converted to a Boolean value. For information on attribute data types, see the Application Server User Guide, available as on-line help (F1) from the IDE.
The following table shows the supported data type conversion from the assigned attributes to the SQLData object.
|
To: |
Boolean |
DateTime |
Float |
Integer |
String |
Timestamp |
|---|---|---|---|---|---|---|
|
MxBoolean |
Y |
X |
Y |
Y |
Y |
X |
|
MxFloat |
L |
X |
Y |
L |
Y |
X |
|
MxDouble |
L |
X |
L |
L |
Y |
X |
|
MxInteger |
L |
X |
Y |
L |
Y |
X |
|
MxString |
V |
V |
V |
V |
Y |
X |
|
MxBigString |
L |
V |
L |
X |
L |
X |
|
MxInternationalizedString |
X |
X |
X |
X |
X |
X |
|
MxTime |
L |
Y |
L |
L |
Y |
X |
|
MxElapsedTime |
L |
Y |
L |
L |
Y |
X |
|
MxDataType |
X |
X |
X |
X |
X |
X |
|
MxSecurity Classification |
X |
X |
X |
X |
X |
X |
|
MxQuality |
X |
X |
X |
X |
X |
X |
|
MxReference |
X |
X |
X |
X |
X |
X |
|
MxStatus |
X |
X |
X |
X |
X |
X |
|
MxCustomStruct |
X |
X |
X |
X |
X |
X |
|
MxCustomEnum |
X |
X |
X |
X |
X |
X |
|
Variant(Unspecified) |
X |
X |
X |
X |
X |
X |
Table Key:
Y = Conversion is supported.
L = Conversion is supported. Data precision loss can occur.
V = Conversion is supported if the value format is the same as the column data type format. For example, in the conversion from MxString to Boolean, the MxString value of "true" equals 1 in Boolean.
X = Conversion is not supported.
The following table shows the supported data type conversion from the SQLData object to the assigned attributes.
|
From: |
Boolean |
DateTime |
Float |
Integer |
String |
Timestamp |
|---|---|---|---|---|---|---|
|
MxBoolean |
Y |
X |
L |
L |
V |
X |
|
MxFloat |
Y |
X |
Y |
Y |
V |
X |
|
MxDouble |
Y |
X |
Y |
Y |
V |
X |
|
MxInteger |
Y |
X |
L |
Y |
V |
X |
|
MxString |
Y |
X |
Y |
Y |
V |
X |
|
MxBigString |
Y |
X |
Y |
Y |
Y |
X |
|
MxInternationalizedString |
X |
X |
X |
X |
X |
X |
|
MxTime |
X |
Y |
L |
L |
V |
X |
|
MxElapsedTime |
X |
Y |
L |
L |
V |
X |
|
MxDataType |
X |
X |
X |
X |
X |
X |
|
MxSecurity Classification |
X |
X |
X |
X |
X |
X |
|
MxQuality |
X |
X |
X |
X |
X |
X |
|
MxReference |
X |
X |
X |
X |
X |
X |
|
MxStatus |
X |
X |
X |
X |
X |
X |
|
MxCustomStruct |
Y |
X |
X |
X |
X |
X |
|
MxCustomEnum |
X |
X |
X |
X |
X |
X |
|
Variant(Unspecified) |
X |
X |
X |
X |
X |
X |
Table Key:
Y = Conversion is supported.
L = Conversion is supported. Data precision loss can occur.
V = Conversion is supported if the value format is the same as the column data type format. For example, in the conversion from MxString to Boolean, the MxString value of "true" equals 1 in Boolean.
X = Conversion is not supported.