Database Toolbox    

Preferences for Queries

Using preferences, you can specify:

  1. Select Preferences from the Query menu.
  1. The Preferences dialog box appears showing the current settings.

  1. Change the current preference settings to the new values and click OK:

    Preference
    Description
    New Value
    Read NULL numbers as
    How NULL numbers in a database are represented when imported into MATLAB.
    For the new value, 0, the NULL data in the example results, will now appear as 0s. Previously, the NULL data appeared as NaN values,
    0
    Data return format
    Format for data imported into MATLAB. Select a value based on the type of data you are importing, memory considerations, and your preferred method of working with retrieved data. You cannot use the Display menu items for the numeric and structure formats.
    Because the results are all numeric, you can change to the new value, numeric, to reduce memory required.
    numeric
    Error handling
    Behavior for handling errors when importing data. In the Visual Query Builder, setting the value to store or empty means any errors are reported in a dialog box rather than the Command Window.
    For the new value, report, any errors from running the query display immediately in the Command Window.
    report
  1. For more information about these preferences, see the descriptions in the reference page for the equivalent function, setdbprefs. Note that the settings for writing strings and numbers are not relevant for use in the Visual Query Builder, since you cannot export data using the Visual Query Builder. However, you can change the settings in the VQB Preferences dialog box and those settings are used if you export data using the Database Toolbox functions.

    If you click OK, the Preferences dialog box closes. If you click Apply, the Preference dialog box remains open, but the preferences are in effect.

  1. Click Execute to run the query again.
  2. View the results in the Command Window.

Preferences apply to the current MATLAB session. They are not saved with a query.

Another way to set preferences is using the setdbprefs function. To use the preferences whenever you run MATLAB, include the setdbprefs function in your startup file.

See Also


 Save Queries