dbregwatch

Description

Request to be notified when a registered procedure executes.

Syntax

RETCODE dbregwatch(dbproc, procedure_name,namelen,
                 options)
 
DBPROCESS     *dbproc;
DBCHAR            *procedure_name;
DBSMALLINT     namelen;
DBUSMALLINT    options;

Parameters

dbproc

A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library/C uses to manage communications and data between the front end and the server.

procedure_name

A pointer to the name of a registered procedure. The registered procedure must be defined in Open Server.

namelen

The length of procedure_name, in bytes. If procedure_name is null-terminated, pass namelen as DBNULLTERM.

options

A two-byte bitmask: DBWAIT, DBNOWAITONE, or DBNOWAITALL.

If options is passed as DBWAIT, dbregwatch will not return until the DBPROCESS connection reads a synchronous notification that the registered procedure has executed.

If options is passed as DBNOWAITONE, dbregwatch returns -immediately. The DBPROCESS connection will receive an asynchronous notification when the registered procedure executes. The connection will receive only a single notification, even if the registered procedure executes multiple times.

If options is passed as DBNOWAITALL, dbregwatch returns immediately. The DBPROCESS connection will receive an asynchronous notification when the registered procedure executes. The connection will continue to receive notifications, one for each execution of the registered procedure, until it informs Open Server that it no longer wishes to receive them.

Returns

SUCCEED, DBNOPROC, or FAIL.

dbregwatch returns FAIL if no handler is installed for the registered procedure.

Usage

See also

dbpoll, dbregexec, dbregparam, dbreglist, dbregwatchlist, dbregnowatch