The other option left was to capture the error from inside the 4GL code by checking the inquire_ingres error number after each sql statement (which does already,but I had to tweak it to also check for the specific error) and act upon it. Since all code is grouped in frskeys (meaning that the user must press a key for the code to be activated) the whole error handling had to be shifted inside the frskey code. Inside the frskey code there can be multiple sql statements and each one can trigger the exception.It might not be the first or second statement but it could be the 5th statement in the chain of execution. Furthermore the 'set maxio' directive is the first statement to be executed when the key is pressed,and must reset back to 'set nomaxio' on exiting or one of the conditions described later are met. So every sql statement must be checked and the following was added after each one: inquire_ingres (h_rowcount=rowcount,h_errorno=errorno,h_querytext=querytext...
A dairy of my work.Just links to the full artices on i-programmer.info