Consultor Eletrônico



Kbase P99477: ERROR-STATUS:ERROR does not return true for oracle error Unique constraint violation using Oracle Da
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/12/2004
Status: Unverified

FACT(s) (Environment):

Oracle DataServer

SYMPTOM(s):

ERROR-STATUS:ERROR does not return true for oracle error Unique constraint violation

ERROR-STATUS:ERROR is not turned on

The following Oracle error should be returning:

unique constraint (%s.%s) violated

The Oracle error is:

ORA-0001 - unique constraint violated

Using RUN STORE-PROCEDURE with NO-ERROR option

CAUSE:

Bug# 20041230-013

CAUSE:

The ERROR-STATUS:ERROR is not being updated because in this specific case the oracle error is not being considered smaller than zero

FIX:

As a workaround use ERROR-STATUS:NUM-MESSAGES > 0

For example:

RUN STORED-PROC proc1 h1 = PROC-HANDLE NO-ERROR ('MA','Mass', 'East') .

IF ERROR-STATUS:ERROR OR ERROR-STATUS:NUM-MESSAGES > 0 THEN DO:
DO i = 1 TO ERROR-STATUS:NUM-MESSAGES :
MESSAGE "error" ERROR-STATUS:GET-NUMBER(i)
ERROR-STATUS:GET-MESSAGE(i) VIEW-AS ALERT-BOX.
END.
END.