Вопрос
Я получаю следующую ошибку при запуске отчета SQR на DB2:
SQL0100W - No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
По данным SQL, работает правильно, когда я вставляю его в RapidsQL, заменяя параметры. Рассматриваемый SQL является выбором внедрения. Никакие ряды не возвращаются избранным, и это хорошо ... Я ожидаю, что отчет будет пустым для моих параметров.
Есть идеи, как я могу обойти это?
Решение 3
Turns out to be an environment setup issue. Got resolved with no change from me after a couple of builds....
Strange :-/
Другие советы
DB2 returns always an SQL0100 warning (this is a warning, not an error - errors would have negative values) when no rows are returned. That's the way it is. I don't know peoplesoft at all - so I can't give you any pointers with that. Back when I was programming for DB2 we ignored those SQL0100 warnings.
If SQR can't gracefully handle a NOT_FOUND SQL0100 return, then code a preliminary query to return a count of the number of rows that satisfy the conditions of the actual query. Check the result of the count in an if-then block in SQR to run the actual query if and only if the row count returned by the preceding query was not zero.