on the mainframe, if I delete rows from a table based on a selection that isn't there (for example, delete from table where column = 1 and there are no rows with a value of 1 in column) I get a return code 100 (no rows found).
I'm trying to figure out how to do the same thing using Reginald. My code is as follows (this is just an example as I play with variations)
odbcerr = "ERROR"
odbcheading = 1
DO
err = odbcexecute(delete_str)
IF err <> "" THEN
rc = show_db2_error.rex(err)
CATCH ERROR
err = CONDITION('D')
IF err <> "" THEN
DO
rc = show_db2_error.rex(err)
rc = write_trace_progress("Delete DB2 row", rc)
rc = 1
END
END
The call to ODBCExecute falls through on the CATCH ERROR, and condition('D') gives"ODBCEXECUTE" reported "" which in this case, isn't really an error. Is there no other way of catching that there were no rows other than looking at the value in err and accepting "ODBCEXECUTE" reported "" as a "non-error" |