Example 3: Remote persistent procedure example using the FUNCTION statement
- Last Updated: May 18, 2026
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
This example shows how a client application invokes a user-defined function,
GetExistingOrder, that is implemented remotely on a
PAS for OpenEdge instance. It is presented as an alternative way to Example 2. The
FUNCTION
GetFirstOrder statement in the following example
replaces the internal procedure GetExistingOrder
referenced in Example 2:
|
Like Example 2, when the RUN statement for order.p completes,
a reference to the persistent procedure context is saved in handle hOrder,
and the SERVER attribute for hOrder contains
a reference to the server handle hAppSrv. However,
instead of running an internal procedure, it runs the user-defined function, GetFirstOrder.
For more information about creating user-defined functions, see the FUNCTION Statement section in the ABL
Reference.
DISCONNECT( ) method on the appropriate handles, OpenEdge
automatically disconnects the client from the server. This automatic disconnection can
also occur if the server machine looses network connectivity with the client
application. This can happen, for example, if there is a network failure.