Data Model > Accessing the UNICOM Intelligence Data Model > Working with the Case Data Model > General information > Data type conversions
 
Data type conversions
The Provider performs implicit type conversion when data is supplied as part of an insert or update. The following table is a summary of data type conversion in the Provider, when converting from the data type shown down the side of the table to the data type shown along the top of the table.
Yes indicates that conversion is allowed, with no restrictions.
Note Level and object types cannot be converted.
 
Double
Long
Text
Categorical
Date
Boolean
Double
 
Yes1
Yes
No
Yes3
Yes11
Long
Yes
 
Yes
Yes10
Yes3
Yes11
Text
Yes2
Yes2
 
Yes4
Yes5
Yes12
Categorical
No
No
Yes
 
No
Yes13
Date
Yes
Yes6
Yes7
No
 
Yes14
Boolean
Yes8
Yes8
Yes9
No
Yes8
 
Notes
1 Conversion results in rounding to the nearest integer
2 Converted if the text can be interpreted as a number, otherwise conversion fails
3 Converted to a Date type. The Date type is implemented using an 8-byte floating-point number. Days are represented by whole number increments starting with 30 December 1899, midnight as time zero: for example, 4 January 1900, 9 P.M. becomes 5.875
4 Conversion succeeds if the text uses the categorical convention of curly braces and commas to delimit numeric values: for example, {2,3,8}.
5 Conversion succeeds if the string can be interpreted as valid date and time. The connection Locale ID affects whether the string format is acceptable for conversion to a date and time value.
6 Conversion results in rounding to the nearest day.
7 Conversion uses the connection Locale ID to output the date and time using the short date and short time formats. If the date or time portions do not exist, they are not returned.
8 Conversion from Boolean to a numeric type results in 1 for True and 0 for False.
9 Conversion uses the connection Locale ID to output True or False in the selected language.
10 Conversion is not possible if the Long is a negative value.
11 The conversion results in a value of False if the numeric value is zero and a value of True for all other numeric values.
12 Conversion uses the connection Locale ID to parse the string and succeeds if it can be interpreted as a recognized Boolean value (numeric value or a string representing True or False).
13 The conversion results in a value of False if the categorical value is empty ({}) and a value of True for all other categorical values.
14 The conversion results in a value of False if the Date value is 30 December 1899 00:00:00 and a value of True for all other Date values.
See also
Locale handling in the UNICOM Intelligence Data Model
Identifier naming conventions
Rules for regular identifiers
Data types
System variables
Conversion functions