Database Toolbox | ![]() ![]() |
Make database changes permanent
Syntax
commit(conn)
Description
commit(conn)
makes permanent the changes made via insert
or update
to the database connection conn
. The commit
function commits all changes made since the last commit
or rollback
function was run, or the last exec
function that performed a commit
or rollback
. The AutoCommit
flag for conn
must be off
to use commit
.
Examples
Ensure the AutoCommit
flag for connection conn
is off
by typing
get(conn,'AutoCommit')
ans = off
Insert the data contained in exdata
into the columns DEPTNO
, DNAME
, and LOC
, in the table DEPT
for the data source conn
. Type
insert(conn, 'DEPT', {'DEPTNO';'DNAME';'LOC'}, exdata)
Commit the data inserted in the database by typing
commit(conn)
The data is added to the database.
See Also
database
, exec
, get
, insert
, rollback
, update
![]() | columns | confds | ![]() |