Previous Topic: Database ProceduresNext Topic: Common Uses of Database Procedures


Specifying a Procedure

Procedures are Called in the Schema

You specify as part of the schema definition when a procedure is to be called. At runtime, these procedures are called automatically; the call is transparent to the application program. You can specify that a procedure be called before or after any of the following DML statements or on an error condition resulting from execution of one of the commands in the following table.

Command

Description

READY

Prepares database areas for processing.

FINISH

Commits changes to the database and terminates the run unit.

COMMIT

Commits changes to the database.

ROLLBACK

Rolls back database changes and optionally terminates the run unit.

STORE

Adds a new record occurrence to the database.

CONNECT

Links a record occurrence to a set.

MODIFY

Changes the data content of an existing record occurrence.

DISCONNECT

Removes a member record occurrence from a set.

ERASE

Deletes a record occurrence from the database.

FIND

Locates a record occurrence in the database.

GET

Moves all data associated with a previously located record occurrence into the requesting program's variable storage.

The OBTAIN DML command combines the functions of the FIND and GET commands; thus, to perform a database procedure on an OBTAIN command, specify the procedure on a FIND and/or GET.