datainsert
(To be removed) Export MATLAB data into database table
The datainsert function will be removed in a future release. Use
the sqlwrite
function instead. For details, see Version History.
Description
Examples
Input Arguments
Tips
When you establish a database connection using a JDBC driver,
datainsertperforms faster thanfastinsert.datainsertuses the SQLTRANSACTIONstatement to insert records with faster performance for these databases:Microsoft® SQL Server®
MySQL
Oracle®
PostgreSQL
For other databases, refer to your database documentation to start a transaction manually. Before running
datainsert, useexecto start the transaction.The value of the
AutoCommitproperty in theconnectionobject determines whetherdatainsertautomatically commits the data to the database.To view the
AutoCommitvalue, access it using theconnectionobject; for example,conn.AutoCommit.To set the
AutoCommitvalue, use the corresponding name-value pair argument in thedatabasefunction.To commit the data to the database, use the
commitfunction or issue an SQLCOMMITstatement using theexecfunction.To roll back the data, use
rollbackor issue an SQLROLLBACKstatement using theexecfunction.
Alternative Functionality
To export MATLAB data into a database, you can use the fastinsert and insert functions. For maximum performance, use
datainsert.