Skip to content

Create an SQL Query

A common way to receive data from an IBM System i (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

  1. Open the File Transfer dialog box. The steps depend on your user interface mode.

    User Interface Mode Steps
    The Reflection Ribbon On the Session tab, from the Transfer group, click File Transfer.
    Classic or Classic MDI On the Tools menu, choose Transfer File.
    The Reflection Browser On the Reflection menu, choose Tools and then File Transfer.
  2. Click Show Host Files. (It may be necessary to enter your user name and password.)

  3. Select one or more host files from which to transfer data.

  4. 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.

  5. Do one of the following:

    • If you already know the syntax for the statement or clause, type it in the text box.

      -or-

    • 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.

More information