Data Type Support

You can import the following data types into the MATLAB® Workspace and export them back to your database:

  • BOOLEAN

  • CHAR

  • DATE

  • DECIMAL

  • DOUBLE

  • FLOAT

  • INTEGER

  • LONGCHAR

  • NUMERIC

  • REAL

  • SMALLINT

  • TIME

  • TIMESTAMP

      Note:   When importing TIMESTAMP data into MATLAB, you might get an incorrect value near the daylight savings time change. Possible workarounds are to convert TIMESTAMP data to strings in your SQL query, and then convert them back to your desired type in MATLAB, or try using a different driver for your database.

  • TINYINT

      Note:   Database Toolbox™ interprets the TINYINT data type as BOOLEAN and imports it into the MATLAB workspace as logical true (1) or false (0). For details about how Database Toolbox handles BOOLEAN data, see Importing and Exporting Boolean Data.

  • VARCHAR

  • NTEXT

You can import data of types not included in this list into the MATLAB Workspace. However, you might need to manipulate such data before you can process it in MATLAB.

    Note:   Data types LONGCHAR and NTEXT are not supported for the native ODBC interface.

Was this topic helpful?