Create an SQL Query
A common way to receive data from an AS/400 is to collect only the data you need from one or more files in the host database; for example, to assemble a list of employee addresses and payroll information, you can collect and transfer only that information to a PC file or to your display, even if the information resides in different host files. You can also specify how to sort data or set conditions that determine which records are transferred. To do this, you would create an SQL query.
If you need help building your SQL query, consult your SQL documentation.
To create an SQL query
- Open the File Transfer dialog box.
- Click Show Host Files. (It may be necessary to enter your user name and password.)
- Select one or more host files from which to transfer data.
- Click Settings, and then click the SQL tab.
The database options Select, Where, Order by, Group by, Having, and Join by appear as text boxes.
- Do one of the following:
- If you already know the syntax for the statement or clause, type it in the text box.
- If you don't know how to create the statement or clause, click the arrow button to the right of the option, and then in the dialog box that opens, specify the field names, functions, operators, options and so on.
The statement is automatically created from your selections.
Note: If the transfer is one you'll be performing regularly, you can save your transfer settings in a transfer request file.