The following example shows the code that DB/Assist calls for the EDBMheneverError default error handling action routine. This code is included in the EDB2.INC file supplied with DB/Assist.
#-------------------------------------------------------------------
# Default Error Routine for Runtime Services
#--------------------------------------------------------------------
action EDB2WheneverError is
call EDB2Error(EDB2ErrorMessage_SV,Esqlca)
send "EDB2 Whenever Error: " EDB2ErrorMessage_SV to errorlog
send "\n******* SQLCA *********" to errorlog
send "\n Sqlcaid = " to errorlog
send Esqlca.Sqlcaid to errorlog
send "\n Sqlcabc = " to errorlog
send Esqlca.Sqlcabc to errorlog
send "\n Sqlcode = " to errorlog
send Esqlca.Sqlcode to errorlog
send "\n Sqlerrml = " to errorlog
send Esqlca.Sqlerrml to errorlog
send "\n Sqlerrmc = " to errorlog
send Esqlca.Sqlerrmc to errorlog
send "\n Sqlerrp = " to errorlog
send Esqlca.Sqlerrp to errorlog
send "\n Sqlerrd[]= " to errorlog
send Esqlca.Sqlerrd[1] to errorlog
send ", " to errorlog
send Esqlca.Sqlerrd[2] to errorlog
send ", " to errorlog
send Esqlca.Sqlerrd[3] to errorlog
send ", " to errorlog
send Esqlca.Sqlerrd[4] to errorlog
send ", " to errorlog
send Esqlca.Sqlerrd[5] to errorlog
send ", " to errorlog
send Esqlca.Sqlerrd[6] to errorlog
send "\n Sqlwarn[]= " to errorlog
send Esqlca.Sqlwarn[1] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[2] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[3] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[4] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[5] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[6] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[7] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[8] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[9] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[10] to errorlog
send ", " to errorlog
send Esqlca.Sqlwarn[11] to errorlog
send "\n Sqlstate = " to errorlog
send Esqlca.Sqlstate to errorlog
send "\n" to errorlog
call EDB2Rollback(Esqlca)
send "Database Rolled Back\n\n" to errorlog