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,
datainsert
performs faster thanfastinsert
.datainsert
uses the SQLTRANSACTION
statement 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
, useexec
to start the transaction.The value of the
AutoCommit
property in theconnection
object determines whetherdatainsert
automatically commits the data to the database.To view the
AutoCommit
value, access it using theconnection
object; for example,conn.AutoCommit
.To set the
AutoCommit
value, use the corresponding name-value pair argument in thedatabase
function.To commit the data to the database, use the
commit
function or issue an SQLCOMMIT
statement using theexec
function.To roll back the data, use
rollback
or issue an SQLROLLBACK
statement using theexec
function.
Alternative Functionality
To export MATLAB data into a database, you can use the fastinsert
and insert
functions. For maximum performance, use
datainsert
.