EXEC SQL WHENEVER { SQLERROR } [ DO ] { GO TO Host-Label } { SQLWARNING } { CALL Host-Label } { NOT FOUND } { PERFORM Host-Label} { CONTINUE } END-EXEC |
main. exec sql whenever sqlerror do perform test-sql-status end-exec ... test-sql-status. if sqlcode not = 0 display message sqlcode x"0d0a" sqlerrmc title "SQL Error" exec sql disconnect all end-exec goback end-if . |