Sqlite Toolkit - @octave_sqlite/commit


: commit (db)

Commit changes to a database

Commit pending transactions of sqlite connection that has AutoCommit = off set.

Inputs

db

Previously created octave_sqlite object

Outputs

None

Examples

Create a database table turn off autocommit and insert a row and commit

 
 # create sql connection
 db = sqlite("mytest.db");
 # create table
 execute(db, 'CREATE TABLE Test (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT)');
 # turn off auto commit
 db.AutoCommit = "off";
 execute(db, 'INSERT INTO Test (Name) VALUES ("Line1")');
 # commit the insert
 commit(db);
 
 

See also: sqlite, rollback.