Putting your queries to work
There are a number of ways to incorporate your .SQL files into your forms, reports and applications.
The quickest way is to add the name of your .SQL file to the SQL property of a Query object.
To do that,
Use the Form or Report designer to open a new form or report.
Choose the Data Access tab on the Component palette, and drag a Query object onto your form.
If it’s not already in view, press F11 to display the Inspector.
In the Query object’s SQL property, type:
@mysql.sql
where mysql.sql is the name of your query file.
Using your .SQL files with the SQL Property Builder
You can use your saved SQL statements as templates in the SQL Property Builder.
To do that, use steps 1-3 from the instructions above, but this time click the tool button next to the SQL property. This opens the SQL Property Builder.
Choose the second option in the builder, SQL Statement File, then click the tool button next to that field. A file search dialog opens to let you locate your saved .SQL file.
When you load the file, your SQL statement appears in the builder’s edit window. You can then either edit the statement or click OK to attach it to the Query object.
Even if you edit the statement, your original .SQL file remains intact, available for modification or updating in the SQL designer or service as a template for another Query object.