Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Working with Preferences

Specifying Preferences

Database Toolbox™ preferences enable you to specify:

  • How NULL data in a database is represented after you import it into the MATLAB® workspace

  • The format of data retrieved from databases

  • The method of error notification

  • The preference for fetching in batches

  1. From Visual Query Builder, select Query > Preferences. The Preferences dialog box appears. Alternatively, from the MATLAB Toolstrip, click Preferences and select Database Toolbox.

  2. Specify the Preferences settings as described in the following table.

    PreferenceAcceptable ValuesDescription

    Read NULL strings as:

    null (default)

    Specifies how NULL strings appear after being fetched from a database.

    Read NULL numbers as:

    Nan (default)

    Specifies how NULL numbers appear after being fetched from a database. If you accept the default value for this field, NULL data imported from databases into the MATLAB workspace appears as NaN. Setting this field to 0 causes NULL data imported into the MATLAB workspace to appear as 0s.

    Write NULL strings as:

    null (default)

    Specifies how NULL strings appear after being exported to a database. This setting does not apply to Database Explorer (dexplore).

    Write NULL numbers as:

    Nan (default)

    Specifies how NULL numbers appear after being exported to a database. This setting does not apply to Database Explorer (dexplore).

    Data return format

    cell array, numeric, structure, or dataset

    Select a data format based on the type of data you are importing, memory considerations, and your preferred method of working with retrieved data.

    • cellarray (default) — Imports nonnumeric data into MATLAB cell arrays.

    • numeric — Imports data into MATLAB matrix of doubles. Nonnumeric data types are considered NULL and appear as specified in the Read NULL numbers as: setting. Use only when data to retrieve is in numeric format, or when nonnumeric data to retrieve is not relevant.

    • structure — Imports data into a MATLAB structure. Use for all data types. Facilitates working with returned columns.

    • dataset — Imports data into MATLAB dataset objects. This option requires Statistics Toolbox™.

    This setting does not apply to Database Explorer (dexplore). If you are using Database Explorer, the data return format is specified using Imported Data panel in the Database Explorer interface.

    Error handling

    store, report, or empty

    • Set this field to store or empty to direct errors to either a dialog box when using Visual Query Builder or a message field when using the Database Toolbox command line interface.

    • Set this field to report to display query errors in the MATLAB Command Window.

      This setting does not apply to Database Explorer (dexplore).

    Cursor Fetch

    Fetch In Batches and Batch Size

    Specifies if fetch retrieves data in batches with a user-defined Batch Size. The default Batch Size is 1,000. For details, see Preference Settings for Large Data Import.

    This setting does not apply to Database Explorer (dexplore). If you are using Database Explorer, the import batch size is specified using Preferences on the Database Explorer Toolstrip.

  3. Click OK. For details about Preferences, see the setdbprefs function reference page.

Was this topic helpful?