XQuery Developer's Guide
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
This appendix provides the details of BEA AquaLogic Data Services Platform (DSP) core support and base support for relational data, and includes these topics:
Each section that follows includes information about:
The tables in this section identify all data type and other mappings that the XQuery engine generates or supports for IBM DB2/NT 8.
The following table lists supported data type mappings.
CLOB1 |
|
DECIMAL(p,s)2 (NUMERIC) |
|
LONG VARCHAR1 |
|
TIME3 |
xs:time4 |
TIMESTAMP5 |
xs:dateTime4 |
xs:string4 |
|
The following table lists functions and operators that are pushed down to IBM DB2/NT8 RDBMSs. See fn-bea:sql-like for details about two-argument and three-argument versions of the fn-bea:sql-like() function.
Table B-2 Functions and Operators
+, -, *, div, idiv1 |
|
mod2 |
|
Numeric comparisons1 |
|
String comparisons3 |
|
concat, upper-case, lower-case, substring(2,3)4, string-length, contains5, starts-with5, ends-with5, fn-bea:sql-like(2,3) fn-bea:trim6, fn-bea:trim-left6, fn-bea:trim-right6 |
|
=, !=, <, <=, >, >=, eq, ne, lt, le, gt, ge on xs:dateTime, xs:date, xs:time |
|
year-from-dateTime, year-from-date, month-from-dateTime, month-from-date, day-from-dateTime, day-from-date, hours-from-dateTime, hours-from-time, minutes-from-dateTime, minutes-from-time, seconds-from-dateTime, seconds-from-time, fn-bea:date-from-dateTime, fn-bea:time-from-dateTime |
|
empty, exists, subsequence7 |
The following table lists supported cast operations.
The following table lists common query patterns that can be pushed down. See Common Query Patterns for details.
Table B-4 Other SQL Generation Capabilities
Fixed (always sorts NULLs high). Order-bys with "empty least" modifier (the XQuery default) are not pushed down. |
|
The tables in this section identify all data type and other mappings that the XQuery engine generates or supports for Microsoft SQL Server 2000.
The following table lists supported data type mappings for Microsoft SQL Server 2000.
DATETIME1 |
xs:dateTime2 |
DECIMAL(p,s)3 (NUMERIC) |
|
NTEXT4 |
|
SMALLDATETIME5 |
|
TEXT4 |
|
Additionally, the following XQuery data types can be passed as parameters or returned by pushed functions:
The following table lists functions and operators that are pushed down to Microsoft SQL Server 2000. See fn-bea:sql-like for details about two-argument and three-argument versions of the fn-bea:sql-like() function.
Table B-6 Function and Operator Pushdown
+, -, *, div, idiv1 |
|
mod2 |
|
Numeric comparisons1 |
|
String comparisons3 |
|
concat, upper-case, lower-case, substring(2,3)4, string-length, contains5, starts-with5, ends-with5, fn-bea:sql-like(2,3)4, fn-bea:trim, fn-bea:trim-left, fn-bea:trim-right |
|
=, !=, <, <=, >, >=, eq, ne, lt, le, gt, ge on xs:dateTime, xs:date, xdt:yearMonthDuration, xdt:dayTimeDuration |
|
year-from-dateTime, year-from-date, years-from-duration, month-from-dateTime, month-from-date, months-from-duration, day-from-dateTime, day-from-date, days-from-duration, hours-from-dateTime, hours-from-duration, minutes-from-dateTime, minutes-from-duration, seconds-from-dateTime, seconds-from-duration, fn-bea:date-from-dateTime |
|
op:add-yearMonthDurations, op:add-dayTimeDurations, op:subtract-yearMonthDurations, op:subtract-dayTimeDurations, op:multiply-yearMonthDuration, op:multiply-dayTimeDuration, op:divide-yearMonthDuration, op:divide-dayTimeDuration, subtract-dateTimes-yielding-yearMonthDuration, subtract-dateTimes-yielding-dayTimeDuration, op:add-yearMonthDuration-to-dateTime, op:add-dayTimeDuration-to-dateTime, op:subtract-yearMonthDuration-from-dateTime, op:subtract-dayTimeDuration-from-dateTime, subtract-dates-yielding-yearMonthDuration, subtract-dates-yielding-dayTimeDuration, op:add-yearMonthDuration-to-date, op:add-dayTimeDuration-to-date, op:subtract-yearMonthDuration-from-date, op:subtract-dayTimeDuration-from-date |
|
empty, exists, subsequence6 |
The following table lists supported cast operations.
The following table lists common query patterns that can be pushed down. See Common Query Patterns for details.
Table B-8 Other SQL Generation Capabilities
The tables in this section identify all data type and other mappings that the XQuery engine generates or supports for Oracle 8.1.x (Oracle 8i).
Additionally, the following XQuery data types can be passed as parameters or returned by pushed functions:
The following table lists functions and operators that are pushed down. See fn-bea:sql-like for details about two-argument and three-argument versions of the fn-bea:sql-like() function.
Numeric arithmetic1 |
|
Numeric comparisons1 |
|
String comparisons2 |
|
concat, upper-case3, lower-case3, substring(2,3)3, string-length4, contains5, starts-with5, ends-with5, fn-bea:sql-like(2,3), fn-bea:trim, fn-bea:trim-left, fn-bea:trim-right |
|
=, !=, <, <=, >, >=, eq, ne, lt, le, gt, ge on xs:dateTime, xs:date, xdt:yearMonthDuration |
|
year-from-dateTime, year-from-date, years-from-duration, month-from-dateTime, month-from-date, months-from-duration, day-from-dateTime, day-from-date, days-from-duration, hours-from-dateTime, minutes-from-dateTime, seconds-from-dateTime, fn-bea:date-from-dateTime |
|
op:add-yearMonthDurations, op:subtract-yearMonthDurations, op:multiply-yearMonthDuration, op:divide-yearMonthDuration, subtract-dateTimes-yielding-yearMonthDuration, op:add-yearMonthDuration-to-dateTime, op:subtract-yearMonthDuration-from-dateTime, subtract-dates-yielding-yearMonthDuration, op:add-yearMonthDuration-to-date, op:subtract-yearMonthDuration-from-date |
|
empty, exists, subsequence6 |
The followingtable lists supported cast operations.
Table B-11 Cast Operation Pushdown
xs:decimal1 |
|
xs:integer1 |
|
xs:float1 |
|
xs:double1 |
|
The following table lists common query patterns that can be pushed down. See Common Query Patterns for details.
Table B-12 Other SQL Generation Capabilities
The tables in this section identify all data type and other mappings that the XQuery engine generates or supports for Oracle 9.x (Oracle 9i) and Oracle 10.x (Oracle 10g). Note that Oracle treats empty strings as NULLs, which deviates from XQuery semantics and may lead to unexpected results for expressions that are pushed down.
CLOB1 |
|
xs:dateTime2 |
|
LONG1 |
|
NCLOB1 |
|
xs:dateTime3 |
|
Additionally, these XQuery data types can be passed as parameters or returned by pushed functions:
The following table lists functions and operators that are pushed down to Oracle 9.x and 10.x. See fn-bea:sql-like for details about two-argument and three-argument versions of the fn-bea:sql-like() function.
Table B-14 Function and Operator Pushdown
Numeric arithmetic1 |
|
Numeric comparisons1 |
|
String comparisons2 |
|
concat, upper-case3, lower-case3, substring(2,3)3, string-length4, contains5, starts-with5, ends-with5, fn-bea:sql-like(2,3), fn-bea:trim, fn-bea:trim-left, fn-bea:trim-right |
|
=, !=, <, <=, >, >=, eq, ne, lt, le, gt, ge on xs:dateTime, xs:date, xdt:yearMonthDuration, xdt:dayTimeDuration |
|
year-from-dateTime, year-from-date, years-from-duration, month-from-dateTime, month-from-date, months-from-duration, day-from-dateTime, day-from-date, days-from-duration, hours-from-dateTime, hours-from-duration, minutes-from-dateTime, minutes-from-duration, seconds-from-dateTime, seconds-from-duration, fn-bea:date-from-dateTime |
|
op:add-yearMonthDurations, op:add-dayTimeDurations, op:subtract-yearMonthDurations, op:subtract-dayTimeDurations, op:multiply-yearMonthDuration, op:multiply-dayTimeDuration, op:divide-yearMonthDuration, op:divide-dayTimeDuration, subtract-dateTimes-yielding-yearMonthDuration, subtract-dateTimes-yielding-dayTimeDuration, op:add-yearMonthDuration-to-dateTime, op:add-dayTimeDuration-to-dateTime, op:subtract-yearMonthDuration-from-dateTime, op:subtract-dayTimeDuration-from-dateTime, subtract-dates-yielding-yearMonthDuration, subtract-dates-yielding-dayTimeDuration, op:add-yearMonthDuration-to-date, op:add-dayTimeDuration-to-date, op:subtract-yearMonthDuration-from-date, op:subtract-dayTimeDuration-from-date |
|
empty, exists, subsequence6 |
The following table lists cast operations that can be pushed down.
xs:decimal1 |
|
xs:dateTime2 |
The following table lists common query patterns that can be pushed down. See Common Query Patterns for details.
Table B-16 Other SQL Generation Capabilities
The tables in this section identify all data type and other mappings that the XQuery engine generates or supports for Pointbase.
DECIMAL(p,s)1 (NUMERIC) |
|
The following table lists functions and operators that are pushed down to Pointbase. See fn-bea:sql-like for details about two-argument and three-argument versions of the fn-bea:sql-like() function.
Table B-18 Function and Operator Pushdown
Numeric arithmetic1 |
|
Numeric comparisons1 |
|
String comparisons2 |
|
concat,upper-case, lower-case, substring(2,3), string-length, contains3, starts-with3, ends-with3, fn-bea:sql-like(2,3) fn-bea:trim, fn-bea:trim-left, fn-bea:trim-right |
|
=, !=, <, <=, >, >=, eq, ne, lt, le, gt, ge on xs:dateTime, xs:date, xs:time |
|
year-from-dateTime, year-from-date, month-from-dateTime, month-from-date, day-from-dateTime, day-from-date, hours-from-dateTime, hours-from-time, minutes-from-dateTime, minutes-from-time, seconds-from-dateTime, seconds-from-time, fn-bea:date-from-dateTime |
|
The following table lists supported cast operations.
Table B-19 Cast Operation Pushdown
xs:decimal1 |
|
xs:double1 |
|
xs:float1 |
|
xs:integer1 |
|
xs:long1 |
|
xs:int1 |
|
xs:short1 |
|
The following table lists common query patterns that can be pushed down. See Common Query Patterns for details.
Table B-20 Other SQL Generation Capabilities
The tables in this section identify all data type and other mappings that the XQuery engine generates or supports for Sybase 12.5.2 (and higher).
As you read through the tables in this section, be aware that Sybase deviates from XQuery semantics (which ignores empty strings) and treats empty strings as a single-space string.
This table defines all data type mappings supported.
DATETIME1 |
xs:dateTime2 |
DECIMAL(p,s)3 (NUMERIC) |
|
SMALLDATETIME4 |
|
TEXT5 |
|
Additionally, the following data types can be passed as parameters or returned by pushed functions:
See "Datetime arithmetic" in Table for details.
The following table lists functions and operators that are pushed down to base RDBMSs. See fn-bea:sql-like for details about two-argument and three-argument versions of the fn-bea:sql-like() function.
Table B-22 Function and Operator Pushdown
+, -, *, div 1 |
|
idiv2 |
|
mod3 |
|
Numeric comparisons1 |
|
String comparisons4 |
|
concat5, upper-case, lower-case, substring(2,3), string-length, contains6, starts-with6, ends-with6, fn-bea:sql-like(2,3), fn-bea:trim, fn-bea:trim-left, fn-bea:trim-right |
|
=, !=, <, <=, >, >=, eq, ne, lt, le, gt, ge on xs:dateTime, xs:date, xs:time, xdt:yearMonthDuration, xdt:dayTimeDuration |
|
year-from-dateTime, year-from-date, years-from-duration, month-from-dateTime, month-from-date, months-from-duration, day-from-dateTime, day-from-date, days-from-duration, hours-from-dateTime, hours-from-time, hours-from-duration, minutes-from-dateTime, minutes-from-time, minutes-from-duration, seconds-from-dateTime, seconds-from-time, seconds-from-duration, fn-bea:date-from-dateTime, fn-bea:time-from-dateTime |
|
op:add-yearMonthDurations, op:subtract-yearMonthDurations, op:multiply-yearMonthDuration, op:divide-yearMonthDuration, op:add-dayTimeDurations, op:subtract-dayTimeDurations, op:multiply-dayTimeDuration, op:divide-dayTimeDuration, op:add-yearMonthDuration-to-dateTime, op:add-yearMonthDuration-to-date, op:subtract-yearMonthDuration-from-dateTime, op:subtract-yearMonthDuration-from-date, op:add-dayTimeDuration-to-dateTime, op:add-dayTimeDuration-to-date, op:subtract-dayTimeDuration-from-dateTime, op:subtract-dayTimeDuration-from-date, fn:subtract-dateTimes-yielding-yearMonthDuration, fn:subtract-dates-yielding-yearMonthDuration, fn:subtract-dateTimes-yielding-dayTimeDuration, fn:subtract-dates-yielding-dayTimeDuration |
|
The following table lists supported cast operations.
Table B-23 Cast Operation Pushdown
xs:double1 |
|
The following table lists common query patterns that can be pushed down. See Common Query Patterns for details.
Table B-24 Other SQL Generation Capabilities
Each JDBC drivers provide information about inherent properties and capabilities of the RDBMS with which it is associated. During the metadata import process, DSP queries a configured data source's JDBC driver for basic properties and capabilities information. Much of the information obtained is stored in the metadata section of the data service definition file (.ds). See Understanding Data Services Platform Annotations for more information.
These database capabilities are obtained from the JDBC driver and stored as properties in the .ds (data service) definition file.
Table B-25 Database Properties for Capabilities
The Data Services Platform XQuery engine typically quotes the names (identifiers) of object names to properly handle any special characters. The identifierQuote property (see Table ) is obtained from the JDBC driver. However, different RDBMSs may use different identifiers for different database object names:
If necessary, you can manually override the identifier quote property for each type of identifier (see Table ).
Typically, the identifierQuote property obtained from the JDBC driver is used. However, if the specific quote property is available and the RDBMS uses it, you can modify the annotation settings in the .ds file (see Relational Data Service Annotations for more information about these properties). The XQuery engine (metadata importer sub-system) uses the specific quote property (see Table ) if it is available, otherwise, it uses the "identifierQuote" property provided by the JDBC driver.
The only exception to this rule is for Sybase versions below Sybase 12.5.2, which is treated as a base platform. Sybase does not use quotes for catalogs even though JDBC drivers return double quote ('"') for "identifierQuote" property. The XQuery engine accommodates this mismatch by automatically setting "catalogQuote" property to the empty string.
Table B-26 Optional Quote Properties for Database Objects
When mapping SQL to XQuery datatypes, DSP XQuery engine first checks the JDBC typecode. If the typecode has a corresponding XQuery type, DSP uses the matching native type name. If no matching typecode or type name is available, the column is ignored.
Table B-27 Data Type Mapping (JDBC<->XQuery Equivalents)
CLOB1 |
||
xs:date2 |
||
DECIMAL (p,s)3 |
||
LONGVARCHAR1 |
||
NUMERIC (p,s)3 |
||
TIME4 |
xs:time4 |
|
TIMESTAMP4 |
xs:dateTime2 |
|
DSP uses native data type name to map to an appropriate XQuery data type. |
||
1. Pushed down in project list only. 2. Values converted to local time zone (timezone information removed) due to DATE limitations. See Date and Time Data Type Differences: Timezones and Time Precision for more information. 3. Where p is precision (total number of digits, both to the right and left of decimal point) and s is scale (total number of digits to the right of decimal point). 4. Precision of underlying RDBMS determines the precision of TIME data type and how much truncation, if any, will occur in translating xs:time to TIME. |
The following table lists functions and operators that are pushed down to base RDBMSs. See fn-bea:sql-like for details about two-argument and three-argument versions of the fn-bea:sql-like() function.
+, -, *1 |
|
div2 |
|
Numeric comparisons1 |
|
String comparisons3 |
|
contains4, starts-with4, ends-with4, fn-bea:sql-like(2), fn-bea:sql-like(3),4 upper-case, lower-case |
|
=, !=, <, <=, >, >=, eq, ne, lt, le, gt, ge on xs:dateTime, xs:date, xs:time |
|
For base RDBMS, cast operations are not pushed down.
The following table shows other SQL Pushdown capabilities, as discussed in Common Query Patterns.
![]() |
![]() |
![]() |