Application Delivery Management
Application Modernization & Connectivity
CyberRes
IT Operations Management
With SQLCA's SQLERRMC limited to PIC X(70), calling Oracle's SQLGLM allows to retrieve error messages longer than 70 characters. The following works fine in 32-bit:
05 ORACLE-ERROR-TEXT PIC X(100) VALUE SPACES. 05 ORACLE-ERROR-SIZE PIC S9(9) COMP-5 VALUE 100. 05 ORACLE-MSG-LENGTH PIC S9(9) COMP-5 VALUE ZERO. CALL 'SQLGLM' USING ORACLE-ERROR-TEXT, ORACLE-ERROR-SIZE, ORACLE-MSG-LENGTHHowever in 64-bit, the same CALL fails with RTS 114 'Attempt to access item beyond bounds of memory'.
The Oracle 64-bit version requires a 64-bit data definition for the length parameters passed to SQLGLM. They should be defined as PIC S9(18) COMP-5.
The following should work across both 32-bit and 64-bit platforms:
05 ORACLE-ERROR-TEXT PIC X(100) VALUE SPACES. $IF P64 SET 05 ORACLE-ERROR-SIZE PIC S9(18) COMP-5 VALUE 100. 05 ORACLE-MSG-LENGTH PIC S9(18) COMP-5 VALUE ZERO. $ELSE 05 ORACLE-ERROR-SIZE PIC S9(9) COMP-5 VALUE 100. 05 ORACLE-MSG-LENGTH PIC S9(9) COMP-5 VALUE ZERO. $ENDNote: The above is also applicable to Net Express.
Fano R. | Support Engineer | Micro Focus