Previous Topic: ACCEPT STATISTICSNext Topic: COMMIT


BIND PROCEDURE

Purpose

Establishes communication between a dialog and a DBA-written procedure.

Syntax

►►─── BIND PROCedure for procedure-name TO ───────────────────────────────────►

 ►─── procedure-control-location ────┬────────────────────┬─── . ─────────────►◄
                                     └─ error-expression ─┘

Parameters

BIND PROCedure for procedure-name

Provides the name of the database procedure.

Procedure-name is either the name of an 8-character variable field that contains the procedure name or the procedure name itself enclosed in single quotation marks.

TO procedure-control-location

Specifies the location to which the named procedure is bound. Procedure-control-location specifies a 256-byte, fixed-length area.

When the BIND PROCEDURE command is executed, information specified in the CA IDMS application program information block is copied into procedure-control-location. At runtime, this information is copied from procedure-control-location back into the CA IDMS application program information block each time the DBMS invokes the procedure. The information passed at runtime is not the information in storage at the time of the procedure call.

error-expression

Specifies status codes that are returned to the dialog.

Usage

Definition

This statement should be used when the application must pass more information to the procedure than that provided by the DBMS. Such instances are unusual.

In most cases, procedures that gain control before or after various database functions are not apparent. After the BIND PROCEDURE command is executed, the DBMS automatically invokes the named procedure for the operations specified in the schema definition.

Note: For more information about database procedures, see the CA IDMS Database Administration Guide.

Considerations

If autostatus is not in use, a dialog's error-status field indicates the outcome of a BIND PROCEDURE command:

Status code

Meaning

0000

The request was executed successfully

1408

The named record or procedure was not in the specified subschema.

1418

The procedure was improperly bound to location 0

1472

The available memory to load a module from the load (core-image) library or DDLDCLOD was not sufficient

1474

An attempt to load a module from the load (core-image) library or DDLDCLOD failed

Example

In the following example, the BIND PROCEDURE command is used to bind the procedure PROGCHEK to the 256-byte area PROC-CTL.

BIND PROCEDURE FOR 'PROGCHEK' TO PROC-CTL.

More information:

Error Handling