Release 10.1A: OpenEdge Data Management:
DataServer for ODBC

> ## Handling errors from stored procedures

> The `RUN` `STORED–PROC` statement supports the `NO–ERROR` option. The following example shows how to trap errors within a procedure:

>     DEFINE VAR j AS INTEGER.
>     RUN STORED-PROC send-sql-statement NO-ERROR
>     		("select count (*) from xxx.customer where name between ’A’ and ’Z’ ").

>     IF ERROR-STATUS:ERROR THEN DO:
>     		DO j = 1 TO ERROR-STATUS:NUM-MESSAGES:
>     			MESSAGE "error" ERROR-STATUS:GET-NUMBER(j)
>     					ERROR-STATUS:GET-MESSAGE(j).
>     		END.
>     END.
>     FOR EACH proc-text-buffer.
>       DISPLAY proc-text-buffer.
>     END.

>     CLOSE STORED-PROC send-sql-statement.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095