![]() |
QUERY/iX Reference Manual
> Chapter 3 QUERY/iX COMMANDSDBLIST |
|||||||||||||||||||
|
SyntaxDBLIST= [data base list]For example: >DBLIST=JOBS,SALES >DBLIST= Parameter
DiscussionIn IMAGE, the same name can be used for different data items in a different data base. You can use a fully-qualified data item name to tell QUERY which data item you want to access. The form is: data base name: data set name. data item name. 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 RulesSession 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 nameYou 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:
data item name IS A MEMBER OF THESE DATA BASES: data base name,data base name,... data base name USED Automatic Data Base List AdditionsIf 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. ExampleThis example illustrates how QUERY uses the data base list, clears it, and enters data base names automatically. >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.
|