Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Working with Preferences

Database Toolbox™ preferences enable you to specify:

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

  • The data return format of imported data

  • The method of error notification

  • How to import data in batches

From the MATLAB Toolstrip, click Preferences and select Database Toolbox.

Specify preferences and click OK. For details, see the setdbprefs function.

PreferenceAcceptable ValuesDescription

Read NULL strings as

null (default)

Specifies how NULL strings appear in MATLAB after being imported from a database.

Read NULL numbers as

NaN (default)

Specifies how NULL numbers appear in MATLAB after being imported from a database. If you accept the default value for this preference, NULL numbers appear as NaN. Setting this preference to 0 causes NULL numbers to appear as 0 in the MATLAB workspace.

Write NULL strings as

null (default)

Specifies how empty character vectors appear in a database after being exported from MATLAB. This setting does not apply to Database Explorer.

Write NULL numbers as

NaN (default)

Specifies how NULL numbers appear in a database after being exported from MATLAB. This setting does not apply to Database Explorer.

Data return format

cellarray (default), table, numeric, or structure

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

  • cellarray — Imports nonnumeric data into MATLAB cell arrays.

  • table — Imports data into a MATLAB table. Use this value for all database data types.

  • numeric — Imports data into a MATLAB matrix of doubles. Nonnumeric data types are considered NULL. The preference setting Read NULL numbers as controls the appearance of this data. Use this value only when the format of the data to import is numeric, or when nonnumeric data to import is not relevant.

  • structure — Imports data into a MATLAB structure. Use this value for all database data types.

These values do not apply to Database Explorer. If you are using Database Explorer, specify the data return format using the Imported Data panel.

Error handling

store (default), report, or empty

Specifies where error messages appear after connecting to a database or importing data.

  • store or empty — Directs errors to:

    • Dialog box when you use Database Explorer

    • Message properties of the connection and cursor objects when you use the command line

  • report — Displays query errors in the Command Window. This value does not apply to Database Explorer.

Cursor Fetch

Fetch In Batches and Batch Size

Specifies that the fetch function imports data in batches if the Fetch In Batches check box is selected.

Specifies the size of the batch to be imported. The default batch size value is 1000 rows of data. To change the batch size, select the Batch Size value. For details, see Preference Settings for Large Data Import.

This setting does not apply to Database Explorer. If you are using Database Explorer, specify the import batch size using Preferences on the Database Explorer toolstrip.

See Also

| |

Related Topics

Was this topic helpful?