I am building a subfile on an SQL loop that is based on selection criteria from an outer SQL loop.
It works. However I'm taking one heck of a performance hit. I believe this is because after all the records are retrieved based on one selection criteria, the inner loop closes the cursor, and control is returned to the outer loop. A new record is FETCHed in the outer loop, a dynamic SQL statement is created, the inner loop cursor is opened, and the process starts again.
Would a right outer join be useful in these circumstances?
Dave
It works. However I'm taking one heck of a performance hit. I believe this is because after all the records are retrieved based on one selection criteria, the inner loop closes the cursor, and control is returned to the outer loop. A new record is FETCHed in the outer loop, a dynamic SQL statement is created, the inner loop cursor is opened, and the process starts again.
Would a right outer join be useful in these circumstances?
Dave
Comment