Database Toolbox |
Build and run a query to export data from MATLAB into new rows in a database. Then save the query for use again later.
You cannot use the VQB to replace existing data in a database with data from MATLAB. Instead, use the update
function. Use Database Toolbox functions instead of the VQB if you require commit and rollback features when exporting data.
Before You Start. Before using the VQB, set up a data source--see Setting Up a Data Source. The examples here use the SampleDB
data source.
To Start. To open the VQB, in the Command Window, type
In the VQB, perform these steps to create and run a query to export data:
SampleDB
, which is the data source for the Nwind
database.
Avg_Freight_Cost
. Table names that include spaces appear in quotation marks. For Microsoft Excel, the Tables are Excel sheets.
Calc_Date
and Avg_Cost
. Field names that include spaces appear in quotation marks. To deselect an entry, use Ctrl+click.
If the data contains NULL
values, specify the format they take. Select Query -> Preferences and specify Write NULL numbers from and Write NULL strings from. For more information about these preferences, see the property descriptions on the reference page for setdbprefs
, which is the equivalent function for setting preferences.
export_data
. Press Enter or Return to view the MATLAB command that exports the data.
If an error dialog box appears, the query is invalid. For example, you cannot perform a query on table and field names that contain quotation marks.
Avg_Cost
value was rounded to a whole number to match the properties of that field in Access.
export.qry
. See Saving, Editing, Clearing Variables for, and Specifying Preferences for Queries.
Retrieving BINARY and OTHER Java Data | BOOLEAN (MATLAB logical) Data |
© 1994-2005 The MathWorks, Inc.