Using the SQL Wizard

You can use the SQL Wizard to create an SQL statement and test it. The graphical user interface of the SQL Wizard makes it much easier to create an SQL statement, compared to typing in the entire text of the SQL statement into the Statement field of the Macro Editor. Also, in the SQL Wizard you can run an SQL statement that you are working on and view the results.
  1. Click SQL Wizard to start the SQL Wizard.
    • If there is any information already in the fields of the statement section, then Z and I Emulator for Web uses this information to initialize the corresponding fields in the SQL Wizard.
  2. Use the SQL Wizard to create an SQL statement and test it.
  3. To close the SQL Wizard without changing your macro, click Cancel.
  4. To save the SQL statement to your macro, do one of the following actions:
    • On the Review tab of the SQL Wizard, click Save; or
    • On the Results tab of the SQL Wizard, click Save SQL.
    The Macro Editor writes the information that you created in the SQL Wizard into the appropriate fields of the statement section. Any already existing information in the fields of the statement section is overwritten. If the information that the Macro Editor writes into a field is a string (for example, the information written into the Database URL field), then the Macro Editor also automatically correctly formats the string depending on the underlying macro type (see The basic macro format versus the advanced macro format). The following fields are updated:
    • Fields in the statement section:
      • Database URL
      • Driver Identifier
      • Driver Class
      • User ID
      • Password
      • Statement
    • Fields in the results section:
      • If, on the Output tab of the SQL Wizard, you selected to output the query results to the Display, then the Macro Editor:
        • Sets the Output Result To field to Dialog.
      • If, on the Output tab of the SQL Wizard, you selected to output the query results to a File, then the Macro Editor:
        • Sets the Output Result To field to File.
        • Sets the File Name field to the file name that you specified in the SQL Wizard.
        • Sets the File Type field to the file type that you specified in the SQL Wizard.
        • Selects the Overwrite radio button or the Append radio button, depending on whether you selected overwrite or append in the SQL Wizard.
        • If the file type is HTML or XML, saves the HTML settings or the XML settings. The Macro Editor does not display these settings, but you can see them, using the Code Editor, in the mlprops attribute of the <sqlquery> element (see <sqlquery> element).
  5. Click Cancel to close the SQL Wizad.