Consultor Eletrônico



Kbase P31014: Error (76) is no longer raised from within a query where exp
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/25/2003
Status: Verified

GOAL:

When is error ** Invalid character in numeric input <character>. (76) not displayed on the screen?

GOAL:

When does code similar to the following generate error 76?

DEF VAR cnt AS INT.

FOR EACH customer
WHERE int(SUBSTRING(postal-code,1,1)) = 2:
cnt = cnt + 1.
display postal-code.
END.
DISP cnt.

CAUSE:

The above code always generates error 76. However, when the user is connecting to the database in server client mode using the -H and -S startup parameters, the FOR EACH statement is resolved on the server and the following error is logged in the database log file and not on the user's screen:

06:23:13 SRV 2: ** Invalid character in numeric input H. (76)

When the user is connecting to the database in self service mode without using the -H and -S startup parameters, the FOR EACH statement is resolved on the client and the same error is displayed on the screen:

** Invalid character in numeric input <character>. (76)

FIX:

To display the above error on the screen even when connected in a client server mode, modify the code along the following lines:

DEFINE VARIABLE cnt AS INTEGER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.

FOR EACH customer:
i = INTEGER(SUBSTRING(postalcode,1,1)) NO-ERROR.
IF ERROR-STATUS:ERROR THEN
MESSAGE ERROR-STATUS:GET-MESSAGE (1)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
IF int(SUBSTRING(postalcode,1,1)) = 2 THEN DO:
cnt = cnt + 1.
display postalcode.
END.
END.
DISP cnt.