XQuery Reference Guide
Supported Data Types
This section provides information about the data types supported in BEA Liquid Data for WebLogic. The following topics are included:
JDBC Types in Liquid Data
In relational databases, data types are described using two methods. The conventional way is to use a JDBC number. For example, an integer is 4, varchar is 12, a date is 91, an so on. These numbers are represented by constants in the java.sql.Types
class, such as Types.INTEGER = 4
and Types.VARCHAR = 12
. This numbering system describes all the JDBC standardized types. However, there are many vendor-specific types, and most of them use the default JDBC number 1111, meaning "other." For this method, there is a name instead of a number associated with each type.
The Liquid Data query generation engine first looks at the JDBC number for a match. If no match occurs, then it uses the name. For example, if the number is 1111, then the query generation engine looks for a name. If there is no match found for either one, the query generation engine treats the column as a string.
Depending on the type of database you access, you need to map external database fields with a compatible data type when you invoke Liquid Data functions. You will notice that some external data types are not supported by Liquid Data. You may need to transform these data types to a supported type before you access that data in a query. The following tables can help you make these decisions.
java.sql.Types Data Types
The following table maps the java.sql.Types
data type to the appropriate data type that you should use with Liquid Data.
Table 4-1 java.sql.Types and Liquid Data Equivalents
java.sql.Types Data Type
|
Liquid Data Data Type
|
Types.ARRAY
|
not supported
|
Types.BIGINT
|
xs:long
|
Types.BINARY
|
xs:string
|
Types.BIT
|
xs:boolean
|
Types.BLOB
|
not supported
|
Types.CHAR
|
xs:string
|
Types.CLOB
|
not supported
|
Types.DATE
|
xs:date
|
Types.DECIMAL
|
xs:decimal
|
Types.DOUBLE
|
xs:double
|
Types.FLOAT
|
xs:double
|
Types.INTEGER
|
xs:integer
|
Types.JAVA_OBJECT
|
not supported
|
Types.LONGVARBINARY
|
xs:string
|
Types.LONGVARCHAR
|
xs:string
|
Types.NUMERIC
|
xs:decimal
|
Types.REAL
|
xs:float
|
Types.REF
|
xs:string
|
Types.SMALLINT
|
xs:short
|
Types.STRUCT
|
not supported
|
Types.TIME
|
xs:time
|
Types.TIMESTAMP
|
xs:dateTime
|
Types.TINYINT
|
xs:byte
|
Types.VARBINARY
|
xs:string
|
Types.VARCHAR
|
xs:string
|
JDBC Data Type Names
The following table maps the native JDBC Data Type name to Liquid Data data types.
Table 4-2 JDBC Data Types and Liquid Data Equivalents
JDBC Name
|
Liquid Data Data Type
|
ARRAY
|
not supported
|
BIGINT
|
xs:long
|
BINARY
|
xs:string
|
BIT
|
xs:boolean
|
BLOB
|
not supported
|
CHAR
|
xs:string
|
CLOB
|
not supported
|
DATE
|
xs:date
|
DEC
|
xs:decimal
|
DECIMAL
|
xs:decimal
|
DOUBLE
|
xs:double
|
FLOAT
|
xs:double
|
INTEGER
|
xs:integer
|
JAVA_OBJECT
|
not supported
|
LONGVARBINARY
|
xs:string
|
LONGVARCHAR
|
xs:string
|
NUM
|
xs:decimal
|
NUMERIC
|
xs:decimal
|
REAL
|
xs:float
|
REF
|
xs:string
|
SMALLINT
|
xs:short
|
STRUCT
|
not supported
|
TIME
|
xs:time
|
TIMESTAMP
|
xs:dateTime
|
TINYINT
|
xs:byte
|
VARBINARY
|
xs:string
|
VARCHAR
|
xs:string
|
Database-Specific Data Type Names
This section includes tables showing the database-specific data type names and the corresponding Liquid Data data types. This section includes the following:
Oracle Data Type Names
The following table maps Oracle names to Liquid Data data types.
Table 4-3 Oracle Data Types and Liquid Data Equivalents
Oracle Name
|
Liquid Data Data Type
|
FLOAT
|
xs:float
|
BFILE
|
not supported
|
LONG
|
not supported
|
LONG RAW
|
not supported
|
NCHAR
|
xs:string
|
NCLOB
|
not supported
|
NUMBER
|
xs:decimal
|
NVARCHAR2
|
xs:string
|
RAW
|
xs:string
|
ROWID
|
xs:string
|
UROWID
|
not supported
|
VARCHAR2
|
xs:string
|
Microsoft SQL Server Data Type Names
The following table maps Microsoft SQL Server names to Liquid Data data types.
Table 4-4 Microsoft SQL Server Data Types and Liquid Data Equivalents
SQL Name
|
Liquid Data Data Type
|
DATETIME
|
xs:dateTime
|
IMAGE
|
not supported
|
INT
|
xs:integer
|
MONEY
|
xs:float
|
NTEXT
|
xs:string
|
NVARCHAR
|
xs:string
|
SMALLDATETIME
|
xs:dateTime
|
SMALLMONEY
|
xs:float
|
SQL_VARIANT
|
xs:string
|
UNIQUEIDENTIFIER
|
xs:string
|
DB2 Data Type Names
The following table maps DB2 data types to Liquid Data data types.
Table 4-5 IBM DB2 Data Types and Liquid Data Equivalents
DB2 Name
|
Liquid Data Data Type
|
CHARACTER
|
xs:string
|
CHARACTER (for bit data)
|
xs:string
|
DATALINK
|
xs:string
|
LONG VARCHAR
|
xs:string
|
LONG VARCHAR (for bit data)
|
xs:string
|
VARCHAR (for bit data)
|
xs:string
|
Sybase Data Type Names
The following table maps Sybase data types to Liquid Data data types.
Table 4-6 Sybase Data Types and Liquid Data Equivalents
Sybase Name
|
Liquid Data Data Type
|
SYSNAME
|
xs:string
|
TEXT
|
xs:string
|
Informix Data Type Names
The following table maps Informix data types to Liquid Data data types.
Table 4-7 Informix Data Types and Liquid Data Equivalents
Informix Name
|
Liquid Data Data Type
|
BLOB
|
not supported
|
BYTE
|
not supported
|
BOOLEAN
|
xs:boolean
|
CHAR(n)
|
xs:string
|
CHARACTER(n)
|
xs:string
|
CLOB
|
not supported
|
DATE
|
xs:date
|
DATETIME
|
xs:dateTime
|
DEC/DECIMAL
|
xs:decimal
|
DOUBLE PRECISION/FLOAT
|
xs:double
|
INT/INTEGER
|
xs:integer
|
INT8
|
xs:long
|
INTERVAL
|
not supported
|
LVARCHAR
|
xs:string
|
MONEY
|
xs:float
|
NCHAR
|
xs:string
|
NUMERIC
|
xs:decimal
|
REAL
|
xs:float
|
SMALLFLOAT
|
xs:float
|
SMALLINT
|
xs:short
|
TEXT
|
xs:string
|