Main Content
connection
Relational database ODBC connection
Description
Create a database connection using an ODBC driver. For details about ODBC drivers and the alternative JDBC drivers, see Choose Between ODBC and JDBC Drivers.
You can use the connection
object to connect to various databases using
different drivers that you install and administer. For details, see Connect to Database.
Properties
Object Functions
close | Close and invalidate database and driver resource utilizer |
commit | Make database changes permanent |
execute | Execute SQL statement using relational database connection |
fetch | Import data into MATLAB workspace from execution of SQL statement |
fetchmulti | Import data from SQL queries |
isopen | Determine if database connection is open |
rollback | Undo database changes |
executeSQLScript | Execute SQL script on database |
select | Execute SQL SELECT statement and import
data into MATLAB |
sqlfind | Find information about all table types in database |
sqlinnerjoin | Inner join between two database tables |
sqlouterjoin | Outer join between two database tables |
sqlread | Import data into MATLAB from database table |
sqlwrite | Insert MATLAB data into database table |
sqlupdate | Update rows in database table |
update | Replace data in database table with MATLAB data |
Examples
Alternative Functionality
You can connect to an SQLite database file by creating the sqlite
object. This connection uses the MATLAB interface to SQLite that does not require installing or administering a database
or driver. For details, see Interact with Data in SQLite Database Using MATLAB Interface to SQLite.
Version History
Introduced before R2006a