(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 Compatibility Considerations.
When you establish a database connection using a JDBC driver,
datainsert
performs faster than
fastinsert
.
datainsert
uses the SQL TRANSACTION
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
, use
exec
to start the transaction.
The value of the AutoCommit
property in the connection
object
determines whether datainsert
automatically
commits the data to the database.
To view the AutoCommit
value, access
it using the connection
object; for example, conn.AutoCommit
.
To set the AutoCommit
value, use
the corresponding name-value pair argument in the database
function.
To commit the data to the database, use the commit
function or issue an SQL COMMIT
statement
using the exec
function.
To roll back the data, use rollback
or
issue an SQL ROLLBACK
statement using the exec
function.
To export MATLAB data into a database, you can use the fastinsert
and insert
functions. For maximum performance, use
datainsert
.