Consultor Eletrônico



Kbase P33588: How to suppress and trap error 129: 'The total length of the fields in an index exceeds max key siz
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Verified

GOAL:

How to suppress and trap error 129: 'The total length of the fields in an index exceeds max key size. (129)'

FIX:

/***
The following code uses the OUTPUT TO statement to suppresses the error message:
'The total length of the fields in an index exceeds max key size. (129)'
by redirecting the output to an error log file.

It also uses the Progress 4GL DO ON STOP statement to trap the error condition
***/

DEFINE TEMP-TABLE ttCustomer LIKE Customer
USE-INDEX Comments.
DEFINE VARIABLE iCounter AS INTEGER NO-UNDO.

FIND FIRST Customer.
CREATE ttCustomer.
BUFFER-COPY Customer TO ttCustomer.

DO iCounter = 1 TO 200:
ASSIGN ttCustomer.Name = ttCustomer.Name + STRING(iCounter).
END.

DO ON STOP UNDO, LEAVE:
OUTPUT TO "errorfile.log".
BUFFER-COPY ttCustomer TO Customer NO-ERROR.
OUTPUT CLOSE.
END.

IF ERROR-STATUS:ERROR THEN
MESSAGE "Error" ERROR-STATUS:GET-NUMBER(1) "occurred"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ELSE
MESSAGE "Ok!" VIEW-AS ALERT-BOX INFO BUTTONS OK.