Use a library function that writes to a shared buffer
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
When you use a CALL statement to invoke a
routine that writes to a shared buffer, you must make sure that
a transaction is active at the time of the call. For example, place
the CALL statement in a DO TRANSACTION block,
as shown in the following code fragment:
|
These notes explain the transaction block:
- The transaction begins.
- The
CALLstatement is defined. - The transaction ends.
The explicit DO TRANSACTION statement
is not the only way to create a transaction in ABL. For example,
you create an implicit transaction when you use the UPDATE statement
within a FOR EACH block.
If your C function calls an HLC library function that writes to a shared buffer, (for
example, prowtbc()), and no transaction is active, the library function
returns a non-zero return code value that indicates an error has occurred and an ABL error
condition results. Use an ON ERROR phrase within your ABL code to handle ABL
error conditions.