Registered procedure call processing

A registered procedure is a procedure that is defined and installed in a running Open Server. Registered procedures require Open Server version 2.0 or later. At this time, registered procedures are not supported by Adaptive Server.

For DB-Library/C applications, registered procedures provide a way for inter-application communication and synchronization. This is because DB-Library/C applications connected to an Open Server can “watch” for a registered procedure to execute. When the registered procedure executes, applications watching for it receive a notification that includes the procedure’s name and the arguments it was called with.

NoteDB-Library/C applications may create only a special type of registered procedure, known as a “notification procedure.” A notification procedure differs from a normal Open Server registered procedure in that it contains no executable statements.

For example, suppose the following:

When stockprice, the monitoring application, becomes aware that the price of Extravagant Auto Parts stock has risen $1.10, it executes price_change with the parameters “Extravagant Auto Parts” and “+1.10”.

When price_change executes, Open Server sends sellstock a notification containing the name of the procedure (price_change) and the arguments passed to it (“Extravagant Auto Parts” and “+1.10”). sellstock uses the information contained in the notification to decide to put 100 shares of Extravagant Auto Parts stock up for sale.

price_change is the means through which the stockprice and sellstock applications communicate.

Registered procedures as a means of communication have the following advantages:

A DB-Library/C application can:

The following are registered procedure routines: