DBLIST= [ QUERY/V Reference Manual ] MPE/iX 5.0 Documentation
QUERY/V Reference Manual
DBLIST=
Informs QUERY which data base to access for multiple data set retrieval
and reporting.
Syntax
DBLIST= [data base list]
For example:
>DBLIST=JOBS,SALES
>DBLIST=
Parameter
data base list is a list of data bases opened with the DEFINE,
DATA-BASE=, and/or MULTIDB commands. Each data
base name must be separated from the next with a
comma. If data base list is not included, the
data base list is cleared.
Discussion
In IMAGE, the same name can be used for different data items in different
data base. You can use a fully-qualified data item name to tell QUERY
which data item you want to access. However, if you are referring to
several data items which appear in multiple data bases, the command could
become quite lengthy. The DBLIST= command can save you some effort.
The DBLIST= command defines a list of one or more data bases. When you
use a JOIN, MULTIFIND, SUBSET, or REPORT command after a MULTIFIND
command, and QUERY encounters a data item name which appears in more than
one data base but is not fully-qualified, it checks the data base list to
resolve the ambiguity.
Data Base Selection Rules
Session Mode
If you reference a data item appearing in more than one data base, QUERY
resolves which data base to use according to the following rule:
If one (and only one) of the data bases containing the data item appears
in the data base list, QUERY automatically uses that data base.
Otherwise QUERY prompts you to supply the desired data base with the
following message:
data item name IS A MEMBER OF THESE DATA BASES:
data base name,data base name,...
WHICH DATA BASE DO YOU WISH TO USE?
>>data base name
You must type the name of the data base you want to access. If the name
you provide does not match the names listed, QUERY repeats the prompt.
If you decide you do not want to access the listed data bases, you may
abort the command by pressing RETURN instead of entering a data base
name. You will be prompted for another command with >.
Job Mode
In job mode, QUERY cannot prompt you for the desired data base in the
event there is ambiguity. The data base to be accessed is chosen
according to the following rules:
* If exactly one data base containing the data item appears in the data
base list, QUERY uses that data base.
* If more than one of the data bases containing the data item appears
in the data base list, QUERY uses the data base mentioned last in the
list. You can check to see which data base is last by using the SHOW
DBLIST command.
* If the data base containing the data set or data item is not included
in the data base list, and the only data base open is the primary
data base, QUERY uses that data base. If additional data bases have
been opened the MULTIDB command, QUERY uses the data base which was
opened last that contains the data set or data item.
If there was any ambiguity, QUERY informs you which data base was used
with the following message:
data item name IS A MEMBER OF THESE DATA BASES:
data base name,data base name,...
data base name USED
Automatic Data Base List Additions
If a JOIN, MULTIFIND, SUBSET, or REPORT command which contains an
unqualified data item name is executed following a MULTIFIND command,
QUERY automatically adds the accessed data base name to the data base
list. This occurs whether or not the named data item occurs in more than
one data base.
To avoid ambiguity when the data item appears in more than one data base,
you can either use fully-qualified data item names in all commands or
always reset the data base list (using the DBLIST= command) prior to
entering a command which uses a data item that appears in more than one
data base. This example illustrates how QUERY uses the data base list,
clears it, and enters data base names automatically.
Example
>SHOW DBLIST
ALBUMS
>JOIN JAZZ.ARTIST TO TAPES:JAZZ.ARTIST
>MULTIFIND JAZZ.LABEL="MMM"
USING SERIAL READ
2 COMPOUND ENTRIES QUALIFIED
>DBLIST=
>REPORT
>>OUT=LP
>>D1,JAZZ.LABEL,30
JAZZ IS A MEMBER OF THESE DATA BASES:
ALBUMS,TAPES
WHICH DATA BASE DO YOU WISH TO USE?
>>TAPES
>>END
>SHOW DBLIST
TAPES
>MULTIFIND JAZZ.YEAR=70
USING SERIAL READ
3 COMPOUND ENTRIES QUALIFIED
>
The SHOW DBLIST command shows that ALBUMS is the only data base in the
data base list. When the JOIN command is entered, ALBUMS is
automatically used for the first occurrence of the JAZZ data set. In the
second occurrence, the data base list is not used since a fully-qualified
data item name is specified. The DBLIST= command clears the data base
list. Since the data base list is cleared when the REPORT command is
entered, QUERY prompts for the data base to be used. TAPES is
automatically added to the data base list. When the next MULTIFIND
command is entered, QUERY automatically uses the TAPES data base because
the data item name is not fully-qualified.
MPE/iX 5.0 Documentation