Database Toolbox |
Structured Query Language (SQL)
The Database Toolbox supports American National Standards Institute (ANSI) standard SQL commands.
Data Types
You can import the following data types into MATLAB and export them back to your database:
BOOLEAN
CHAR
DATE
DECIMAL
DOUBLE
FLOAT
INTEGER
LONGCHAR
(This is called the Memo data type in Microsoft Access.)
NUMERIC
REAL
SMALLINT
TIME
TIMESTAMP
TINYINT
VARCHAR
If you try to export MATLAB data types not on this list, you see a syntax error from the database.
BINARY and OTHER Java SQL Data Types
You can import BINARY
(referred to as BLOB for Binary Large Objects) and OTHER
JDBC objects. To use these data types in MATLAB, you need to understand the content, and you might need to massage it, such as stripping off headers created by the ODBC/JDBC drivers so a specific binary format can be used in MATLAB. For an example using the Visual Query Builder, see Retrieving BINARY and OTHER Java Data. For an example using functions, see Retrieving BINARY or OTHER Java SQL Data Types. In some cases, retrieving OTHER
data types does not result in any data.
Data Type Restrictions
If you try to retrieve 64-bit FLOAT
data from Microsoft SQL Server, you might lose precision (retrieve only 32 bits), or experience data corruption. For a workaround, contact MathWorks Support.
Drivers | Setting Up a Data Source |
© 1994-2005 The MathWorks, Inc.