swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
function  

db.commit

 
 

Library: Database access (OMDB)
Import: omdb.xmd

Declaration

define external function db.commit
       value db.database database

Argument definitions

database
is a db.database object obtained by opening a connection to a database using one of the db.open functions.


Purpose

Use db.commit to commit all the insert, delete, or update operations performed since the last db.commit or db.rollback.

Requirements

The db.database object database must be:

Usage Notes

Calls to this function are only required if the database transaction type is db.manual-commit.

You may call the db.commit function if the transaction type for the database is auto-commit without generating an exception.

Example


  import "omdb.xmd" prefixed by db.
  
  process
      local db.database this-db
      local db.table course
      local stream SQL-insert initial
      {  "insert into Course values " ||
          " ( '503', 'Learning Through Pain'  )"
      }
  
      local stream course-data variable initial
      {   '504' with key 'CID',
            'What is that Sound?' with key 'CourseName'
      }
  
      set this-db to db.open-odbc 'dbDemo'
      set course to db.open-table in this-db named 'Course'
      db.set-transaction-type of this-db to db.manual-commit
  
      db.execute-in this-db sql SQL-insert
  
      db.insert into course from course-data
  
      db.commit this-db

    Related Topics
 
Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.