DB2 10.5 for Linux, UNIX, and Windows

Limits for XQuery data types

This topic identifies the range of values that are allowed for specific DB2® XQuery data types.

Table 1. Limits for XQuery numeric data types
Data type Smallest value Largest value Additional limits

xs:float

-3.4028234663852886e+38

+3.4028234663852886e+38

  • Smallest positive value: +1.1754943508222875e-38
  • Largest negative value: -1.1754943508222875e-38

xs:double

-1.7976931348623158e+308

+1.7976931348623158e+308

  • Smallest positive value: +2.2250738585072014e-308
  • Largest negative value: +2.2250738585072014e-308

xs:decimal

Not available

Not available

  • Largest decimal precision: 31 digits
xs:integer -9 223 372 036 854 775 808 +9 223 372 036 854 775 807  
xs:nonPositiveInteger -9 223 372 036 854 775 808 0  
xs:negativeInteger -9 223 372 036 854 775 808 -1  
xs:long -9 223 372 036 854 775 808 9 223 372 036 854 775 807  
xs:int -2 147 483 648 +2 147 483 647  
xs:short -32 768 +32 767  
xs:byte -128 +127  
xs:nonNegativeInteger 0 +9 223 372 036 854 775 807  
xs:unsignedLong 0 +9 223 372 036 854 775 807  
xs:unsignedInt 0 4 294 967 295  
xs:unsignedShort 0 +65 535  
xs:unsignedByte 0 +255  
xs:positiveInteger +1 +9 223 372 036 854 775 807  
Table 2. Limits for XQuery date, time, and duration data types
Data type Smallest value Largest value
xs:duration -P83333333333333Y3M11574074074DT1H46M39.999999S P83333333333333Y3M11574074074DT1H46M39.999999S
xdt:yearMonthDuration -P83333333333333Y3M P83333333333333Y3M
xdt:dayTimeDuration -P11574074074DT1H46M39.999999S P11574074074DT1H46M39.999999S
xs:dateTime 0001-01-01T00:00:00.000000Z 9999-12-31T23:59:59.999999Z
xs:date 0001-01-01Z 9999-12-31Z
xs:time 00:00:00Z 23:59:59Z
xs:gDay 01Z 31Z
xs:gMonth 01Z 12Z
xs:gYear 0001Z 9999Z
xs:gYearMonth 0001-01Z 9999-12Z
xs:gMonthDay 01-01Z 12-31Z
Note: DB2 XQuery provides no support for negative dates or negative times.