Built-in Open Query by SQL SELECT Statements (Magic xpa 3.x)
In Magic xpa, you can use the Built-in Open Query feature by defining the SQL SELECT statement, Ctrl+H, in the AS/400 Open Query File screen, as described below.
-
Make sure that the task contains a defined Main Source.
-
In the Magic xpa Task Properties dialog box, set the Main Source Index property to 0 and the Transaction property to Physical.
-
Make sure that the selected fields in the SELECT Statement have field types that are the Main Source’s field type.
-
Make sure that the number of selected fields in the SELECT Statement matches the number of fields in the Main Source. You can create a dummy table in the Data repository with the required fields.
-
From the Task menu, click IBM i Open Query File to specify a Query Select string for an Open Query File operation on a task. Magic xpa opens the AS/400 Open Query File dialog box.

-
Select the SQL SELECT Statements and click OK.
Note: Use the SQL SELECT Statements with the Fetch Only option.