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 Database Toolbox 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

On the MATLAB Toolstrip, in the Environment section, click Preferences and select Database Toolbox.

Specify preferences as described in this table, and click OK. For details, see the setdbprefs function.

PreferenceAcceptable ValuesDescription

Read NULL strings as

null (default), any text value

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

Read NULL numbers as

NaN (default), any numeric value

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), any text value

Specifies how empty character vectors or string scalars appear in a database after being exported from MATLAB.

Write NULL numbers as

NaN (default), any numeric value

Specifies how NULL numbers appear in a database after being exported from MATLAB.

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.

Error handling

store (default) or report

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

  • store — Directs errors to the Message properties of the connection and cursor objects when you use the command line.

  • report — Displays query errors in the Command Window.

See Also

| |

Related Topics

Was this topic helpful?