There are no restrictions on the contents of a function that implements an ESP. The only requirement is that it be written in a procedural programming language capable of:
Calling a C-language function
Manipulating C-language datatypes
Linking with the Open Server API
However, an ESP function should not call a C runtime signal routine on Windows. This can cause XP Server to fail, because Open Server does not support signal handling on Windows.
By using the Open Client API, an ESP function can send requests to Adaptive Server, either to the one from which it was originally invoked or to another one.