Data types of values from external sources

There are two external sources from which data can be extracted by ESQL:
  • Message fields
  • Database columns

The ESQL data type of message fields depends on the type of the message (XML for example), and the parser used to parse it. The ESQL data type of the value returned by a database column reference depends on the data type of the column in the database.

The following table shows which ESQL data types the various built-in DBMS data types are cast to, when they are accessed by WebSphere Message Broker.

The DBMS products are DB2 (version shipped with the product), SQL Server Version 7.0, Sybase Version 12.0, and Oracle Version 8.1.5

  DB2 SQL Server and Sybase Oracle
BOOLEAN   BIT  
INTEGER SMALLINT, INTEGER, BIGINT INT, SMALLINT, TINYINT  
FLOAT REAL, DOUBLE FLOAT, REAL NUMBER()1
DECIMAL DECIMAL DECIMAL, NUMERIC, MONEY, SMALLMONEY NUMBER(P)1, NUMBER(P,S)1
CHARACTER CHAR, VARCHAR, CLOB CHAR, VARCHAR, TEXT CHAR, NCHAR, VARCHAR2, NVARCHAR2, ROWID, UROWID, LONG, CLOB,
TIME TIME    
GMTTIME      
DATE DATE    
TIMESTAMP TIMESTAMP DATETIME, SMALLDATETIME DATE
GMTTIMESTAMP      
INTERVAL      
BLOB BLOB BINARY, VARBINARY, TIMESTAMP, IMAGE, UNIQUEIDENTIFIER RAW LONG, RAW BLOB
BIT      
Not supported DATALINK, GRAPHIC, VARGRAPHIC, DBCLOB NTEXT, NCHAR, NVARCHAR NCLOB, BFILE
Note:
  1. If an Oracle database column with NUMBER data type is defined with an explicit precision (P) and scale (S), it is cast to an ESQL DECIMAL value; otherwise it is cast to a FLOAT.
    For example, an ESQL statement like this:
    SET OutputRoot.xxx[]
     = (SELECT T.department FROM Database.personnel AS T);

    where Database.personnel resolves to a TINYINT column in an SQL Server database table, results in a list of ESQL INTEGER values being assigned to OutputRoot.xxx.

    By contrast, an identical query, where Database.personnel resolves to a NUMBER() column in an Oracle database, results in a list of ESQL FLOAT values being assigned to OutputRoot.xxx.

Related concepts
ESQL overview
Related tasks
Developing ESQL
Related reference
Complex ESQL functions
CAST function
Supported casts
Implicit casts