Defining the SQL functions
The Advanced SQL options allow you to extract specific information from host files.
If you are using more than one file, you must prefix each file name with the T# counter. For example if you need the average of three fields, type the following commands:
•  AVG (T1.SRCDTA)
•  AVG (T2.SRCDTA)
•  AVG (T3.SRCDTA)
Where:
•  T#: represents the file
•  SRCDATA: represents the field
This format applies to all SQL clauses in the Advanced SQL Request Editing dialog box.
To use the Advanced SQL options, follow these steps:
1. Click the Advanced SQL tab on the Download options dialog box.
2. Use the following fields to extract the information you need from the AS/400 files:
•  Select
•  From
•  Where
•  Order by
•  Group by
•  Join by
•  Having
All of these functions are explained in Advanced SQL Request Editing on page 152 of the user guide. You can click on the SQL function button to select the various SQL commands. For example, if you click the Select button, the Select dialog box opens: The Select dialog box displays all the fields for the select member. You can double-click the fields you wish to use and click the parameter buttons to build your SQL function. Your complete SQL function appears in the field at the top of the dialog box.
3. Once you define the SQL functions you want to use, you have three options:
•  Click OK.
•  Click the Date/Time options tab.
•  Click the PC File tab.