Extended stored procedures

An extended stored procedure (ESP) uses the same interface as a stored procedure, but instead of containing SQL statements and control-of-flow statements, it executes procedural language code that has been compiled into a dynamic link library (DLL).

The procedural language in which an ESP function is written can be any language capable of calling C language functions and manipulating C datatypes.

ESPs allow Adaptive Server to perform a task outside the relational database management system (RDBMS), in response to an event occurring within the database. For example, you could use an ESP to send an e-mail notification or network-wide broadcast in response to an event occurring within the RDBMS.

There are some Adaptive-Server-supplied ESPs, called system extended stored procedures. One of these, xp_cmdshell, allows you to execute an operating system command from within Adaptive Server. Chapter 18, “Using Extended Stored Procedures,” describes ESPs. See also Chapter 3, “System Extended Stored Procedures,” Reference Manual: Procedures.

ESPs are implemented by an Open Server™ application called XP Server™, which runs on the same machine as Adaptive Server. Remote execution of a stored procedure is called a remote procedure call (RPC). Adaptive Server and XP Server communicate through RPCs. XP Server is automatically installed with Adaptive Server.