
– If your expression performs a division operation, avoid dividing by zero by defining the denominator
as the result field just before the result field with a division. Then, for all logical OR groupings of
record selection, add a logical AND test stating the denominator must not equal zero.
v
On the three lines provided, you can split a field name, numeric constant, or character string at the end
of one line and continue it at the beginning of the next. When you split a field name or a numeric
constant, do
not
put spaces at the end of the first line or at the beginning of the next line because
Query then treats it as
two
field names or numeric constants. Character constants (that is, characters
enclosed in apostrophes) can be split at any point. A DBCS character constant can be split by placing a
shift-in character in the last position of the upper line and a shift-out character in the first position of the
lower line.
v
When using a field to divide, you must also select that field not equal to zero as the first selection
before any other result fields are processed, as in the following example:
v
1. AND/OR Field Test Value
2. ODQYSD NE 0
3. AND OMCRMM EQ 0
4. AND OMSTAT EQ ’50’
5. AND ODSTAT NE ’99’
6. AND PCT LT 90
7. AND PCT LT 90
8. AND OMUSOR LIST ’DT’ ’ET’ ’SR’ ’RT’
v
To make your expressions easier to read, you can use blanks between field names and operators.
v
You can create up to 100 result fields.
v
Substring and concatenation operations are not allowed with date, time, timestamp or numeric fields. To
circumvent this, use the CHAR function around the date, time, or timestamp field and the DIGITS
function for numeric fields.
Query determines the data type of the result field according to the following:
If the first value in the expression is a numeric field name, a numeric constant (like the number
7
or
−3.14
), or a function that returns a numeric value, then the result field is numeric.
If the SUBSTR function is used, the result field is an SBCS character field if the value is SBCS,
DBCS-only, or DBCS-either. The result field is a DBCS-open field if the value is DBCS-open. The result
field is a DBCS-graphic field if the value is DBCS-graphic. A substring of a fixed-length field can be
either a variable- or fixed-length field, depending on how you define the length and offset.
If the expression is a constant, field, or function, the data type of the result field is the data type of the
constant, field, or value returned by the function.
If the concatenation operation is used and all of the values being concatenated are DBCS-only, the
result field is DBCS-only.
If the concatenation operation is used and all of the values being concatenated are DBCS-graphic, the
result field is DBCS-graphic.
If the concatenation operation is used and one of the values being concatenated is DBCS-either, or if
the expression contains a mixture of SBCS and bracketed-DBCS fields or constants, the result field is
DBCS-open.
If a variable-length field is concatenated to either a fixed or variable-length field, the result is a
variable-length field.
If two or more fixed-length fields are concatenated, the result is a fixed-length field.
If two fixed-length DBCS fields are concatenated, the result is a variable-length field.
84
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 ...