To validate the query:
To verify that the CA Dataquery language syntax and table and column names in the query are correct, press <PF10>. Receiving the message indicating that no errors were found means the query has been successfully validated.
Completed Example
=> DQ214I - QUERY VALIDATION WAS SUCCESSFUL AND NO ERRORS WERE FOUND --------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR ------------------------------------------------------------------------------- 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 02 WITH SHIP-QTY GT 0 03 SET SHIP-PRICE(7.2) = UNIT-PRICE * SHIP-QTY 04 SORT BY (CUST-ID) 05 PRINT FROM TITLE1 'FILLED CUSTOMER ORDERS' 06 CUST-ID 07 ITM-ID 08 SHIP-QTY 09 UNIT-PRICE 10 (SHIP-PRICE) PICTURE 'Z,ZZZ,ZZ9.99-' 11 WHEN CUST-ID BREAKS ------------------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> EXECUTE <PF4> SAVE <PF5> DIALOG DEF <PF6> DELETE <PF7> BACKWARD <PF8> FORWARD <PF9> UPDATE <PF10> VALIDATE <PF11> RIGHT/LEFT <PF12> CREATE MODE
Action
To keep this query so that it can be executed more than once, press <PF4> SAVE. Since the query is correct, it can be executed now as described in Executing Online. Turn to the section summary to see the report.
Other Things You Could Do
You could validate your query while still in the CREATE MODE.
If you receive an error message about DQL syntax or a table or column name, make the correction specified in the error message. If you do not understand the message, press <PF1> HELP for an explanation. Once the correction is made, validate your query again. Repeat the validation option until all errors are corrected.
You may want to convert a query like this to a dialog that lets you specify variables for table, column and key names, literal values and functions. A dialog serves multiple purposes and lets you obtain different data without having separate queries. To see how this sample query can be converted to a dialog, see the steps in Creating Dialogs.
|
Copyright © 2014 CA.
All rights reserved.
|
|