User`s guide
5 Using Visual Query Builder
5-62
VQB Query Elements in Generated Files
The following VQB query elements do not appear in generated files:
• Generated code files do not include MATLAB workspace variables to which you
assigned query results in the VQB query. The file assigns the query results to e;
access these results using the variable e.Data. For example, you can add a statement
to the file that assigns a variable name to e.Data as follows:
myVar = e.Data
• For security reasons, generated files do not include passwords required to connect to
databases. Instead, the database statement includes the string 'password' as a
placeholder. To run files to connect to databases that require passwords, substitute
your password for the string password in the database statement.
Saving Queries
1
Click Query > Save. The Save SQL Statement dialog box appears.
2
Enter a name (without spaces) for the query into the File name field and click Save.
Save the query as basic.qry.
Note: When you save a Select query (a query that imports data), MATLAB does not save
your specified preferences or the workspace variable that contains the query results.
This prevents you from inadvertently overwriting an existing variable in the MATLAB
workspace when you run a saved query.
When you save an Insert query (a query that exports data), MATLAB saves the
workspace variable whose data you exported, but does not save your preferences.
Running Saved Queries
1
Click Query > Load. The Load SQL Statement dialog box appears.
2
Select the name of the query you want to load and click Open. The VQB fields reflect
the values for the saved query.
3
Run a Select query to import data into the MATLAB workspace, or an Insert query
to export data from the MATLAB workspace.