I have built a recursive sql code. This code never stops, so that I have to kill the process. As it was running, I did monitor the run of the code with tool db2mon. The problem is that after some times it keeps reading, but not fetching or writing anymore.
As the warning "... may contain infinite loop ..." accured, I looked at the manual of db2. The manual says that there are 2 important things to be added in the where clauses. One of them is:
The where clause should include the limit gap:
countColumn < Constant
[/CODE]countColumn < HostVariable[/CODE]
In my code, for that I have fulfilled this, BUT insted of <, it is a <= (not smaller than, but smaller than or even)
I am confused if that could be the problem, why sql is still reading and reading.
I know it is a complex theme, but is there any common considerations if the code is not stopping?
if possible : always publish full sql code - level and platform
as the fetch does not occur anymore (no more rows) the counter is not incrementing anymore and is always equal to the :hv
there are many samples in the forum about this and also in information center
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be