dbExecute

function

Library: Database access (OMDB legacy)
Include: omdb.xin

Declaration
define external function dbExecute
       value dbDatabase database
   SQL value string     statement

Argument definitions

database
is a dbDatabase object obtained by opening a connection to a database using one of the dbOpen functions.
statement
is the SQL statement that you want to execute on the database.


Purpose

Use dbExecute to execute a single SQL statement on the specified database.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omdb.xin"

The dbDatabase object database must be:

The stream variable statement must not be empty (else external exception OMDB105).

Usage Notes

The SQL statement may modify the structure of the database or manipulate the data in the tables. It may be any non-select type of SQL statement.

Example:

This function makes use of the dbDatabase OMX variable used to create the connection to the database. For example:

            include "omdb.xin"
          process
             local dbDatabase my-database
             local stream SQL-insert initial
                { "insert into Course (cid, CourseName) "
                   || "values ('456', 'Four-on-the-Floor Gearshifting')"
                }
             set my-database to dbOpenODBC "dbDemo"
             dbExecute my-database
             	sql SQL-insert