If the test pattern consists of two apostrophes alone (
’’ or G’’
) or two apostrophes enclosing only DBCS
shift-out and shift-in characters (
’s/os/i’ or G’s/os/i’
), the test pattern is treated as an empty string.
These patterns will select records in which the field contains an empty string.
Using more than one comparison test in Query for iSeries
When you use more than one comparison, you need to tell Query how to connect them by typing a
connection in the
AND/OR
column. The two types of connections are:
v
AND connections
v
OR connections
If you do not specify anything in the
AND/OR
column between comparisons, Query assumes AND.
All
of
the comparisons that are connected by ANDs must be true for the record to be selected by that group of
comparisons.
For example, to select records for all customers with the last name of
’Clarke’
and who live in Arizona
(
‘AZ’
) requires an AND connection:
Select Records
Type comparisons, press Enter. Specify OR to start each new group.
Tests: EQ, NE, LE, GE, LT, GT, RANGE, LIST, LIKE, IS, ISNOT...
AND/OR Field
Test
Value (Field, Number, or ’Characters’)
LASTNAME
EQ
’Clarke’
AND
STATE
EQ
’AZ’
____
______________
_____ ______________________________
____
______________
_____ ______________________________
____
______________
_____ ______________________________
____
______________
_____ ______________________________
Bottom
________________________________________________________________________
ACCTNUMBER
STREETADDR
CRLIMIT
YEAR
COMPANY
CITY
BALDUE
MONTH
FIRSTNAME
STATE
PASTDUE
MIDDLEINIT
ZIPCODE
DATEPAID
LASTNAME
TELENUMBER
CURRENTDAT
Bottom
F3=Exit
F5=Report
F9=Insert
F11=Display text
F12=Cancel
F13=Layout
F20=Reorganize
F24=More keys
Although this example shows the AND typed in the
AND/OR
column, it is not necessary. (If you leave the
AND/OR
column blank, Query assumes an AND connection.) Comparisons connected with one or more
ANDs are considered a group of comparisons.
The other kind of connection between comparisons is OR; that is, one or more of the comparisons (or
groups of comparisons) must be true for the record to be selected.
Because Query assumes AND connections unless told otherwise, you must specify
OR
in the
AND/OR
column whenever you want an OR connection.
For example, to select records in which the last name is
Kingsbury
or the credit limit is greater than or
equal to
$5,000
requires an
OR
connection:
Chapter 7. Selecting records in Query for iSeries
101
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 ...