Implicit CASTs for assignment
- A message field (or equivalent in an exception or destination list)
- Support for implicit conversion between the IBM® Integration Bus data types and the message (in its bitstream form) depends on the appropriate parser. For example, the XML parser casts everything as character strings before inserting them into the WebSphere® MQ message.
- A field in a database table
-
IBM Integration Bus converts each of its data types into a suitable standard SQL C data type, as detailed in the following table. Conversion between this standard SQL C data type, and the data types supported by each DBMS, depends on the DBMS. Consult your DBMS documentation for more details.
The following table lists the available conversions from IBM Integration Bus to SQL data types
IBM Integration Bus data type SQL data type NULL, or unknown or invalid value SQL_NULL_DATA BOOLEAN SQL_C_BIT INTEGER SQL_C_LONG FLOAT SQL_C_DOUBLE DECIMAL SQL_C_CHAR1 CHARACTER SQL_C_CHAR TIME SQL_C_TIME GMTTIME SQL_C_TIME DATE SQL_C_DATE TIMESTAMP SQL_C_TIMESTAMP GMTTIMESTAMP SQL_C_DATE INTERVAL Not supported2 BLOB SQL_C_BINARY BIT Not supported2 Notes:- For convenience, DECIMAL values are passed to the DBMS in character form.
- There is no suitable standard SQL C data type for INTERVAL or BIT. Cast these to another data type, such as CHARACTER, if you need to assign them to a database field.
- A scalar variable
- When assigning to a scalar variable, if the data type of the value
being assigned and that of the target variable data type are different,
an implicit cast is attempted with the same restrictions and behavior
as specified for the explicit CAST function. The only exception is
when the data type of the variable is INTERVAL or DECIMAL.
In both these cases, the value being assigned is first cast to a CHARACTER value, and an attempt is made to cast the CHARACTER value to an INTERVAL or DECIMAL. This is because INTERVAL requires a qualifier and DECIMAL requires a precision and scale. These must be specified in the explicit cast, but must be obtained from the character string when implicitly casting. Therefore, a further restriction is that when implicitly casting to an INTERVAL variable, the character string must be of the form INTERVAL '<values>' <qualifier>. The shortened <values> form that is acceptable for the explicit cast is not acceptable here.