IBM SC41-5210-04 Server User Manual


 
Chapter 3. Creating a Query for iSeries query definition
This chapter describes the process of creating a query (that is, defining a query definition object) that can
be used to query one or more files in the DB2
®
UDB for iSeries. The chapter begins with selecting option
1 (Create) on the Work with Queries display, and then it introduces the Define the Query display and the
11 possible definition steps you can use to define a query or change part of an existing query definition.
The details for each of the definition steps are described later, in Chapters 4 through 14. The details for
each of the other major tasks then follow in Chapters 15 and 16.
Starting Query for iSeries query definition
You start query definition by selecting option 1 (Create) on the Work with Queries display and, optionally,
by specifying the name of the query you want to create.
To specify a query name, you can type the name of the query (Query prompt) that you want to define, and
you can specify the name of the library (Library prompt) in which it is to be stored. Or, you can look at a
list of query names or library names to select the query name and the library name you want to use.
For example, you might specify CUSNAMQRY as the name of a query definition that you would use to query
the CUSTNAME file. If you do not specify a library name, the query is stored in the library identified in the
Library prompt (the QGPL library in this example).
Work with Queries
Type choices, press Enter.
Option ....... _ 1=Create 2=Change 3=Copy 4=Delete
5=Display 6=Print definition
8=Run in batch, 9=Run
Query ....... __________ Name, F4 for list
Library...... QGPL Name, *LIBL, F4 for list
F3=Exit F4=Prompt F5=Refresh F12=Cancel
If you are creating a query (definition), you do not need to name it unless you want to save it for later use.
(The query does not exist as a definition object on the system until you save it.) If you do name it, use the
normal rule for naming objects, which follows:
The query name must begin with an alphabetic character (A through Z, $, #, or @) and can be followed by
no more than 9 alphanumeric characters (A through Z, 0 through 9, $, #, @, ., or _).
Note: To use this query in a multilingual environment, use A-Z or 1-9.
Because most system-supplied objects on the iSeries system begin with Q, your query names should not
start with a Q.
© Copyright IBM Corp. 2000, 2002 27