Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Using Procedures, Triggers, and Batches

Using SELECT statements in batches Next Page

Calling external libraries from procedures

You can call a function in an external library from a stored procedure or user-defined function. You can call functions in a DLL under Windows operating systems, in an NLM under NetWare, and in a shared object on Unix. You cannot call external functions on Windows CE.

This section describes how to use the external library calls in procedures. Sample external stored procedures, plus the files required to build a DLL containing them, are located in the following folder: samples-dir\SQLAnywhere\ExternalProcedures. For information on the location of samples-dir, see Samples directory.


External libraries called from procedures share the memory of the server. If you call an external library from a procedure and the external library contains memory-handling errors, you can crash the server or corrupt your database. Ensure that you thoroughly test your libraries before deploying them on production databases.

The API described in this section replaces an older API. The older API is deprecated. Libraries written to the older API, used in versions before version 7.0.x, are still supported, but in new development you should use the new API.

SQL Anywhere includes a set of system procedures that make use of this capability, for example to send MAPI email messages.

For more information on system procedures, see System Procedures.

Creating procedures and functions with external calls
External function prototypes
Passing parameters to external functions
Hiding the contents of procedures, functions, triggers and views