Previous Topic: Edit the FIND StatementNext Topic: Step 3: Specify Conditions


Select the Table Name

The table name can be typed in, if you know it. However, even if you know the table name, you may want to select it from the list to avoid misspelling the name. After pressing <PF6>, the following panel appears:

 =>  Place the cursor on the desired name and press the appropriate PFkey  --------------------------------------------------------------------------DQAF0  DATAQUERY:  DIRECTORY OF TABLES             Datadictionary BASE ID: 189                                    START WITH:  ______________________________  -------------------------------------------------------------------------------        TABLE NAME                 |STATUS|     DESCRIPTION  -------------------------------------------------------------------------------    ADDRESS                        |  O   |    CAI-ACCTS-TBL                  |  O   | ORDER ENTRY DEMO ACCTS ROW    CAI-CUST-TBL                   |  O   | CUSTOMERS ROW    CAI-DETAIL-TBL                 |  O   | DETAILS ROW    CAI-ITEMS-TBL                  |  O   | ITEMS ROW    CAI-ORD-NO-TBL                 |  O   | ORDER NUMBERS ROW    CAI-ORDERS-TBL                 |  O   | ORDERS ROW    CAI-RCPTS-TBL                  |  O   | ORDER ENTRY DEMO RECEIPTS ROW    CAI-SHIPTO-TBL                 |  O   | SHIP-TO ROW    CAI-SLSHST-TBL                 |  O   | ORDER ENTRY DEMO SALES-HIST ROW    CAIDEMO-DEM-PNC                |  O   | CAI SAMPLE PART COST TABLE    CAIDEMO-DEM-PNM                |  O   | CAI SAMPLE PART MASTER TABLE    CAIDEMO-DEM-POL                |  O   | CAI SAMPLE P.O. LINE-ITEM ROW  -------------------------------------------------------------------------------  <PF1> HELP         <PF2> RETURN       <PF3> DISPLAY COLUMNS <PF4>DISPLAY KEYS  <PF5> DISPLAY ALL  <PF6> DISPLAY TEXT <PF7> BACKWARD        <PF8>FORWARD

The table names shown on this panel are entity-names assigned to the database tables you can access. If a table you need is not listed, see your CA Dataquery Administrator.

Action

On the above panel:

  1. Place the cursor on the name of the table to be selected.
  2. Press <PF2> RETURN to return to the CREATE MODE panel.

Place the cursor on CAI-DETAIL-TBL to indicate that this is the table to be selected for use in the query. Pressing <PF2> returns to the CREATE MODE panel. When this panel is redisplayed, the name of the table selected is inserted in the location marked with the cursor.

Completed Example

 =>  --------------------------------------------------------------------------DQD10  DATAQUERY:  EDITOR            CURRENT TABLE:  CAI-DETAIL-TBL  -------------------------------------------------------------------------------  NAME:          USER-SAMPLE                       TYPE: QUERY   STATUS: PRIVATE  DESCRIPTION:   TOTAL ORDERS PER CUSTOMER -- AVERAGE PRICE     ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.  .. ================================ T O P =====================================  01  FIND ALL  CAI-DETAIL-TBL ROWS  .. ===========================  B O T T O M  ==================================  -------------------------------------------------------------------------------  <PF1> HELP          <PF2>  RETURN     <PF3> DISPLAY COLUMNS<PF4>DISPLAY KEYS  <PF5> DISPLAY ALL   <PF6>  LIST TABLES<PF7> BACKWARD       <PF8>FORWARD  <PF9> TEMPLATE      <PF10> VALIDATE   <PF11>RIGHT/LEFT     <PF12>PROCESS MODE

After returning to the above panel following table selection, the space bar and DELETE key can be used to clean up the appearance of the FIND statement. Notice that the CURRENT TABLE: field at the top of the panel now contains the name of the table selected. There is only one line in the query, now marked by a line number to the left of the display. In the next step you see how to use EDITOR line commands to insert more lines for creating the rest of the query. After completing the FIND statement, go to the next step.

Other Things You Could Do

If you know the format of the DQL FIND statement and the name of the table you are going to search, you can type in the statement without using aids, such as the query template or table list.

You do not have to search all the rows in a table. You could specify a number of rows to locate, such as 10 or 20, instead of ALL.

If you only need to know the number of rows in a table or the number of a certain type of row, and you do not need a report, you can use a COUNT statement instead of a FIND statement. Executing a query with a COUNT statement returns an online message stating the number of rows found.