[Stackoverflow] [Progress OpenEdge ABL] Returning error string from abl if no match

Status
Not open for further replies.
S

sander

Guest
I'm trying to search the database and then delete a record if a match is found. Then if no match is found, I would like to return an error in string format with the error message.

DEF INPUT PARAM i_cCarID LIKE Car.carID NO-UNDO.
DEFINE OUTPUT PARAMETER o_cErrorMsg AS CHARACTER NO-UNDO.
DEF BUFFER carBuffer_B1 FOR Car.


FIND FIRST carBuffer_B1 WHERE carBuffer.carID= i_cCarID EXCLUSIVE-LOCK NO-ERROR.

IF AVAIL(carBuffer_B1) THEN DO:
DELETE carBuffer_B1 NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
o_cErrorMSG = "Error: ".
RETURN o_cErrorMsg + ERROR-STATUS:GET-MESSAGE(1).
END.
END.


This code doesn't seem to return any errors when called from java.

Edit 1. Does not finding a match even result in an error or do you have to somehow explicitly "throw" an error?

Continue reading...
 
Status
Not open for further replies.
Top