IBM SC41-5210-04 Server User Manual


 
If you specify *FILE, *FIRST, or *LAST in this prompt, a member is created with the same name as the file
if the file is created or replaced or has no members.
If *FIRST or *LAST is used with a request to put the output into a new member of an existing file containing
members, Query for iSeries sends an error message. You need to cancel the request or replace the
member named in the message.
Data in file in Query for iSeries reports: Type the number of one of the following options to tell Query
(at the time it is running your query) how to use the file and member you specified in the File and Member
prompts:
1=New file
Creates a new file with the name specified in the File prompt and a member with the name indicated
in the Member prompt. While running the query, if Query finds a file by that name in the library
specified in the Library prompt, a message is displayed. You can either type a C (cancel) to cancel
running the query or type a G (go) to continue running, thereby indicating that the file is to be replaced
by the data from your query.
2=Replace file
Replaces the existing file named in the File prompt with the data from your query. The file and all the
members of the file are deleted, and your data is put into a new member that is named with the name
specified in the Member prompt.
3=New member
Creates a new member with the name specified in the Member prompt. While running the query, if
Query finds a member by that name or a *FIRST or *LAST member in the file specified in the File
prompt, a message is displayed. You can either type a C (cancel) to cancel running the query or type a
G (go) to continue running, thereby indicating that the member is to be replaced by the data from your
query.
4=Replace member
Replaces the existing member named in the Member prompt with the data from your query. All the
data in that member is deleted, and your data is added. If a member by that name did not exist, the
member is created and the data is put in it.
5=Add to member
Adds the data from your query at the end of the data in the existing member named in the Member
prompt. If a member by that name did not exist, the member is created and the data is put in it.
When your query data is put into a file that exists and is not being replaced, the format of the query data
must be compatible with the record format definition of the existing database file. To be compatible, the
following must be true:
v The formats must have the same number of fields.
v Corresponding fields in sequence in the formats (that is, the first, second, third fields, and so on) must
have field definitions of the same data type and, except for date, time, and timestamp data types, must
have the same length, scale, precision, and keyboard shift. Date, time, or timestamp fields need only
have the same data type for example, both date fields.
For any of the options that replace data in existing files or members, the following also controls whether
you can replace that data. The data cannot be replaced in a file or member if:
v Other files depend on the definition of this file. For example, you cannot replace the data in a physical
database file on which other logical database files are based. You can use the Display Database
Relations (DSPDBR) command to see the relationships of a file to other files.
v You do not have the needed authority for the file to be replaced.
v The file is not a physical file or it has more than one format definition.
v The output file or member names are the same as any of the selected files or members used in your
query.
158 Query for iSeries Use V5R2