If, for example, you have an RPGLE program doing an SQL Select into host variables, but the SQL select returns multiple rows, the SQL statement will fail with state 21000, code -811 error "Result of SELECT more than one row".
Now say I have a massive set of programs doing lots of selects, where the original programmer opted to ignore SQL errors on many of them and proceed without erroring out or logging the error. The process completes, but I see lots of instances of this error in the job log.
But because its embedded SQL, rather than providing the statement number of the failed select statement in the RPGLE, the error provides the statement number in program QSQRUN2 or similar.
Is there any way to trace these SQL errors to an RPGLE statement number, short of debugging and checking each select statement individually?
Now say I have a massive set of programs doing lots of selects, where the original programmer opted to ignore SQL errors on many of them and proceed without erroring out or logging the error. The process completes, but I see lots of instances of this error in the job log.
But because its embedded SQL, rather than providing the statement number of the failed select statement in the RPGLE, the error provides the statement number in program QSQRUN2 or similar.
Is there any way to trace these SQL errors to an RPGLE statement number, short of debugging and checking each select statement individually?
Comment