Version 3 Release 1.1 ****** ** ** ********* ** ** *** *** ** Query ** ** **** **** ******* Management ** ** ** ** ** ** ** Facility ** * ** ** **** ** ** ****** ** ** ** ** * ________________________________________
Type command on command line or use PF keys. For help, press PF1 or type HELP. ______________________________________________________________________________
1=Help 2=List 3=End 4=Show 5=Chart 6=Query
7=Retrieve 8=Edit Table 9=Form 10=Proc 11=Profile 12=Report OK, you may enter a command.
COMMAND ===>
Figure 5–26, QMF Home Panel
5.3.1.1 Using the SHOW Command
Use the SHOW command to move among the different panels that QMF uses in building a query and formatting the results of that query. These panels are known as object panels. To access the
Show Command Prompt panel, use the following procedure:
• Type SHOW at the “Command” prompt. • Press ENTER.
The Show Command Prompt panel displays (Figure 5–27). This panel lists object panels that can be accessed using the SHOW command.
_______________________________________________________________________________ +---+
| SHOW Command Prompt |
| |
| Enter the name or number of the panel to show. ( ) |
| 1 to 13 of 17 |
| 1. PROFile Current user profile |
| 2. PROC Current procedure |
| 3. Query Current query |
| 4. Report Current report |
| 5. CHARt Default chart |
| 6. Globals Global variable list |
| 7. FOrm Current form |
| 8. Form.Main Basic report formatting |
| 9. Form.COLumns Column attributes |
| 10. Form.CONditions User-defined conditions |
| 11. Form.CAlc User-defined calculations |
| 12. Form.Page Page heading and footing text |
| 13. Form.Detail Detail text |
+---+
| F1=Help F3=End F7=Backward F8=Forward |
+---+ Please follow the directions on the command prompt panel.
Figure 5–27, Show Command Prompt Panel
• Type PROFILE or 1, the name or number of the desired panel. • Press ENTER.
You can also display the user profile by pressing the PROFILE key from the QMF Home Panel or by typing the command Display PROFILE or shortcut DI PROFILE on the command line from any QMF panel.
5.3.1.2 Setting the Profile Values
After selecting the PROFILE option from the SHOW Command Prompt panel, you should see your profile data (Figure 5–28). It describes your interactive environment with QMF and is kept in the database by QMF. Your profile tells QMF what choices to make when presenting
information for viewing or printing. For an online explanation of Profile options, press the
PROFILE
General Operands:
CASE ===> UPPER Enter UPPER, STRING, or MIXED. DECIMAL ===> PERIOD Enter PERIOD, COMMA, or FRENCH. CONFIRM ===> YES Enter YES or NO.
LANGUAGE ===> PROMPTED Enter SQL, QBE, or PROMPTED. MODEL ===> REL Enter REL or ER.
Defaults for printing:
WIDTH ===> 132 Number of characters per line. LENGTH ===> 60 Number of lines per page. PRINTER ===> Printer to be used for output. QMF Administration Operands: (Not usually changed) SPACE ===> “DSQTSDEF”
Enter the name of SQL/DS DBSPACE in which tables will be saved by the SAVE DATA command.
TRACE ===> NONE
Enter ALL, NONE or a character string of function-id, trace-level pairs.
1=Help 2=Save 3=End 4=Print 5=Chart 6=Query
7= 8= 9=Form 10= 11= 12=Report
OK, PROFILE is shown. COMMAND ===>
Figure 5–28, QMF Profile
• CASE ==> UPPER
QMF recognizes commands only in uppercase characters. When CASE==>UPPER is set, QMF changes data entered in lowercase to uppercase.
• DECIMAL ==> PERIOD
A period (.) is the most common decimal point indicator. Other indicators are available, one example being a comma.
• CONFIRM ==> YES
When YES is selected, QMF displays a confirmation panel before a command changes or replaces an object in the database. We recommend this option be set to YES to prevent accidentally overwriting something.
• LANGUAGE ==> SQL
QMF provides three ways to write queries:
1. Structured Query Language (SQL) 2. Prompted Query (Prompted) 3. Query-by-Example (QBE)
Prompted Query builds a retrieval query by prompting you for information about the data you want. SQL and QBE are languages for writing queries.
The choice specified in the profile determines whether an SQL, QBE, or Prompted Query panel displays when you create or display a query. To create queries using the Prompted
1. Press TAB to advance the cursor to the LANGUAGE option. 2. Type prompted.
3. Press ENTER.
• MODEL ==> REL
QMF can work with two types of data: relational (REL) and entity-relationship (ER) data. NSLDS uses relational data stored in DB2. This option should never be changed.
The options PRINTER, SPACE, and TRACE should never be changed without first checking with the Customer Service Center.
5.3.1.3 Saving Your Profile
The changes you made to your profile remain in effect only until you end your QMF session, unless you save the changed profile.
To save your changed profile:
• Press the SAVE key (PF2).
• Press the END key (PF3) to return to the QMF Home Panel.
The profile you saved is stored in the database. It is in effect when you next log on to QMF. If you want the changes to take effect immediately, end your QMF session and start a new one.
5.3.2 Creating a Prompted Query
A prompted query (Figure 5–29) provides menus that prompt you to create queries. To create queries, you must know the tables you want data from, the names of columns within the table, row conditions, and the sequence in which you want to display the rows. In other words, the same information you needed for an SQL query.
The dialog panels of Prompted Query guide you through listing tables, getting information about the tables, selecting tables and columns, and building row conditions without your having to know the syntax of an SQL query.