The actual length of the result depends on the number of characters in the argument. Each character of
the argument determines a character of the result. Regardless of the CCSID, every double-byte code point
in the argument is considered a DBCS character, and every single-byte code point in the argument is
considered an SBCS character with the exception of the EBCDIC mixed data shift codes X’0E’ and X’0F’.
v
If the nth character of the argument is a DBCS character, the nth character of the result is that DBCS
character.
v
If the nth character of the argument is an SBCS character that has an equivalent DBCS character, the
nth character of the result is that equivalent DBCS character.
v
If the nth character of the argument is an SBCS character that does not have an equivalent DBCS
character, the nth character of the result is the DBCS substitution character.
The equivalence of SBCS and DBCS characters depends on M.
If the result is UCS2 then, each character of the argument determines a character of the result. The nth
character of the result is the UCS2 equivalent of the nth character of the argument.
Date, time, and timestamp expressions in Query for iSeries
Date, time, and timestamp data types and values can be assigned to result fields. A date, time, or
timestamp expression for a result field can contain the following, alone or in combination:
v
Date, time, or timestamp field names
(names of fields that contain date, time, or timestamp values)
v
Character constants
(SBCS or DBCS characters enclosed in apostrophes— see examples and rules
under “Query for iSeries character expressions” on page 60.)
v
Date, time, and timestamp functions and operations
(one or more of the following functions and
arithmetic operations):
+ (Addition)
− (Subtraction)
CHAR
CURRENT
VALUE
DATE
DAY
DAYS
MONTH
YEAR
TIME
HOUR
MINUTE
SECOND
MICROSECOND
TIMESTAMP
v
Durations
(a length of time, represented by a labeled duration, date duration, time duration, or
timestamp duration— see “Durations in Query for iSeries” on page 73.)
Character constants can represent date, time, or timestamp values when used with date, time, or
timestamp fields or functions. They can be used in expressions and treated like a date, time or timestamp.
For example, a date constant may be subtracted from a date field.
A date, time, or timestamp expression for a result field can contain the following either alone or in
combination:
66
Query for iSeries Use V5R2
Summary of Contents for @server iSeries
Page 1: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 2: ......
Page 3: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 12: ...x Query for iSeries Use V5R2 ...
Page 14: ...2 Query for iSeries Use V5R2 ...
Page 32: ...20 Query for iSeries Use V5R2 ...
Page 38: ...26 Query for iSeries Use V5R2 ...
Page 44: ...32 Query for iSeries Use V5R2 ...
Page 116: ...104 Query for iSeries Use V5R2 ...
Page 122: ...110 Query for iSeries Use V5R2 ...
Page 146: ...134 Query for iSeries Use V5R2 ...
Page 150: ...138 Query for iSeries Use V5R2 ...
Page 174: ...162 Query for iSeries Use V5R2 ...
Page 178: ...166 Query for iSeries Use V5R2 ...
Page 196: ...184 Query for iSeries Use V5R2 ...
Page 198: ...186 Query for iSeries Use V5R2 ...
Page 204: ...192 Query for iSeries Use V5R2 ...
Page 205: ...Part 4 Appendixes Copyright IBM Corp 2000 2002 193 ...
Page 206: ...194 Query for iSeries Use V5R2 ...
Page 210: ...198 Query for iSeries Use V5R2 ...
Page 242: ...230 Query for iSeries Use V5R2 ...
Page 256: ...244 Query for iSeries Use V5R2 ...
Page 270: ...258 Query for iSeries Use V5R2 ...
Page 272: ...260 Query for iSeries Use V5R2 ...
Page 292: ...280 Query for iSeries Use V5R2 ...
Page 293: ......
Page 294: ... Printed in U S A SC41 5210 04 ...