You can modify the EAB sample code to exclude SQLCA data that you do not need, to return additional data, or to extend the length of the error message. If you do this, you must also modify the view definitions in your model to agree with your changes to the code. If you rename the EAB source member, you must also rename (repackage) it in your model.
Once again, this EAB must not be called except after a WHEN DATABASE statement has executed. The EAB uses the SAVE-SQLCA area in GLOBDATA to obtain the SQLCA data it returns. The generated application only saves the SQLCA in this area under the following conditions:
The SQLCA is not saved when a logical exception statement executes, or when a database call succeeds. So, GET_xxx_SQLCA cannot be used to retrieve SQLCA data associated with WHEN SUCCESSFUL, WHEN NOT FOUND, WHEN ALREADY EXISTS, WHEN NOT UNIQUE, or WHEN PERMITTED VALUE VIOLATION statements.
However, after a WHEN DATABASE statement has executed, the saved SQLCA for that statement is available from then on, unless replaced by the SQLCA for a subsequent WHEN DATABASE statement. So, this EAB may be used at any time to return the SQLCA for the last database exception, regardless of how many intervening database calls were made since that WHEN DATABASE statement executed.
|
Copyright © 2013 CA.
All rights reserved.
|
|