We have an application that uses SQL to select the records for a report. The application has been working with
over 50 customers using all different operating systems. We haven't changed the program or the operating systems, but have come across a number of instances that the SQL has stopped selecting records. We haven't been able to figure out the problem. Our solution has been to use an older version of the program that uses an open-query file instead of SQL.
OPNQRYF and SQL essentially use the same engine code to select and reject records, so the two interfaces behaving differently should not occur very often. Is it possible that SQL is returning the rows in a different order instead of not selecting the right records? This is possible with SQL since the order of the results is only guaranteed when an ORDER BY clause is included on your SQL request. If ordering of the result rows is not the problem, then I'd suggest that you make sure you have the latest database group PTF. If you have the latest fixes and the problem still persists, then report this as a defect to IBM Support.
MORE INFORMATION ON THIS TOPIC
Search400.com's targeted search engine: Get relevant information on DB2/400.
The Best Web Links: tips, tutorials and more.
Check out this online event, Getting the Most out of SQL & DB2 UDB for the iSeries.
Dig deeper on DB2 UDB (universal databases)
Related Q&A from Kent Milligan
To monitor members stuck within a physical file on AS/400, you can periodically use the display file description (DSPFD) command to create an output ...continue reading
Create a host variable of the where in statement on the fly with dynamic SQL.continue reading
To solve the SQL error -321 on IBM i6.1, use the new values statement to overcome the error. If you are using an older release, declare a cursor ...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.