Database Toolbox    

Saving a Query

After building a query in the VQB, you can save it for later use. To save a query:

  1. Select Save from the Query menu.
  1. The Save SQL Statement dialog box appears.

  1. Complete the File name field and click Save. For the example, type basic as the filename.
  1. The query is saved with a .qry extension.

The MATLAB workspace variable name you assigned for the query results and the query preferences are not saved as part of the query.

Using a Saved Query

To use a saved query:

  1. Select Load from the Query menu.
  1. The Load SQL Statement dialog box appears.

  1. Select the name of the query you want to load and click Open. For the example, select basic.qry.
  1. The VQB fields reflect the values for the saved query.

  1. To run the query, assign a variable in the MATLAB workspace variable field and click Execute.

  Creating, Running, and Saving a Query Specifying Preferences for NULLS, Data Format, and Error Handling