Single-run/singleton procedure example
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
User-defined function defined by CustomerInfo.p
The following example shows a user-defined
function defined by a procedure called CustomerInfo.p.
|
The version of CustomerInfo.p in Persistent procedure sample cannot be run
as a single-run (or singleton) because it has a parameter in the main block. Creating
another internal procedure to set CustNum would also not
work, because a single-run procedure is deleted from the application server after each call.
Context must be established for each call. So in User-defined function defined by
CustomerInfo.p CustNum is passed as a parameter to the
user-defined function GetTotalOrdersByNumber instead.
OpenAPI code to run the single-run procedure
The following OpenAPI code runs CustomerInfo.p as
a single-run procedure and then calls its user-defined function.
The code also shows how to access the procedure type using the ProcedureType parameter.
A singleton procedure can be run in the same way, with ProcedureType.Singleton substituted
into the CreatePO method.
|
A singleton procedure can be run in the same way, with ProcedureType.Singleton substituted into the CreatePO method. Unlike a single-run procedure, a singleton
procedure remains instantiated on the application server after execution, but you still need
to use Dispose() to clean up resources on the client
side.