Replace data in database table with MATLAB data
The value of the AutoCommit
property in the connection
object
determines whether update
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.
You can use datainsert
to
add new rows instead of replacing existing data.
To update multiple records, the number of SQL WHERE
clauses
in whereclause
must match the number of records
in data
.
If the order of records in your database is not constant, then you can use values of column names to identify records.
If this error message appears when your database table is open in edit mode:
[Vendor][ODBC Product Driver] The database engine could not lock table 'TableName' because it is already in use by another person or process.
Then, close the table and rerun the update
function.
Running the same update operation again can cause this error message to appear.
??? Error using ==> database.update Error:Commit/Rollback Problems