IBM SC41-5210-04 Server User Manual


 
Chapter 1. What is Query for iSeries?
Query for iSeries is an IBM
®
licensed program and a decision support utility that can be used to obtain
information from the DB2 Universal Database for iSeries database. It can obtain information from any
database files that have been defined on the system using Operating System/400 (OS/400
®
) data
description specifications (DDS), the OS/400 interactive data definition utility (IDDU), or DB2 UDB for
iSeries Structured Query Language (SQL).
You use Query to select, arrange, and analyze information (data) stored in one or more database files to
produce reports and other data files. You can create your own query definitions and then run them, you
can run existing queries that you did not create, or you can even run a default query against a particular
database file (using an unnamed query). You determine what data the query is to retrieve, the format of
the report, and whether it should be displayed, printed, or sent to another database file.
You can use Query to obtain information from a single file or a combined set of up to 32 files. You can
select all the fields, or a few of the fields and organize them as you want them to appear in the type of
output chosen. You can have all records in the files included in the output, or you can select only a few to
be included, using record selection tests. These and other functions are described in detail later.
This chapter begins by introducing basic information about Query, and then it introduces all the major
tasks (such as creating, displaying, or running query) that can be done using Query.
Query for iSeries fundamentals
Several elements on your system organize and store information, or data, so that you and other system
users can work with it to get the results that you need. The following topics introduce those elements, tell
you about them and how they relate to you and Query, and direct you to other publications where you can
find more information.
Files, fields, and record formats in Query for iSeries
Information, or data, is organized and stored on your system in various forms, primarily in objects called
database files (usually referred to as just files). A file contains individual units of information, called
records, that each contain related pieces of data. Each piece of information in a record is called a field,
and how the fields are organized is defined in a record format (often just called a format).
When you run a query to produce a report, Query uses the files, fields, and record formats to get the
information you want from the database, in the form of records, and uses those records to produce a
query report.
For example, an employee name and address file named NAMEADDR might contain a group of records that
identify one employee in each record (see Figure 1). Each record has several fields that contain the name
and address of an employee. The fields in each record might have names like NAME, STREETADDR, CITY,
STATE, and ZIPCODE. This order of the fields might be specified in a record format also named NAMEADDR.
NAME STREETADDR CITY STATE ZIPCODE
Susan P Gantner 907 Abbey Hwy Mushroom Manor OR 67891
Perry C Swenson 19821 Metro Hwy. St. Paul OR 67891
Matt F Thomas 961 S 19th Ave Piney Island OR 67890
Figure 1. Three Records in NAMEADDR File (Using Record Format NAMEADDR)
© Copyright IBM Corp. 2000, 2002 3
|
|