Rule Definition
A result set is the set of rows selected by an SQL query. The EGL open statement sends a query to the database manager. The EGL for each or get next are used to retrieve the rows in the setone at a time for processing.
VisualAgeGenerator connected the statements using the SQL record name specified on both statements. However in scenarios where there were multiple opens in the program for the same record, the generated program had to be smart enough to connect the statements to the result set that was currently opened.
EGL allows a handle called a result set identifier to be specified on the open statement that selects the result set and the foreach or get next statements that process the set.
Remediation
Try to always specify a result set id when doing result set operations like open/get next or open.
Reference
EGL Best Practices: Coding For Performance. November 10, 2009. Edition 2
Related Technologies
Technical Criterion
Efficiency - SQL and Data Handling Performance
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.