75 pts.
 OPNQRY and ovrdbf
Hi, Can you please tel about OPNQRY and OVRDBF, why we are going to use them, Thanks &Regars, Raum

Software/Hardware used:
ASKED: June 30, 2008  11:10 AM
UPDATED: July 2, 2008  2:45 PM

Answer Wiki:
OVRDBF can be used to redirect the file selection to a file of another name or in a specific library. OPNQRYF provides a method to select records, join files, etc. It is a lot like SQL select. We would usually see the two together - the override requires the share(*yes) so called programs get access to the query file. Here is a CL pgm OVRDBF file(xxxx) share(*yes) OPNQRYF file(xxxx) QRYSLT( 'STFLD = "MO"')) Call rpg1 CLOF OPNID(xxxx) DLTOVR(*ALL) endpgm This query would limit select records to those with MO in the STFLD. It would appear to program rpg1 that the file xxxx only contained records for 'MO' This can provide flexibility to a rather simple RPG program. The QrySlt can be a *char variable which you can build based on your current need. There is much more to these commands. Phil Regarding OPNQRYF: It uses the original, or classic query engine (CQE) which IBM is no longer enhancing for performance and additional functionality, so it is better to use embedded SQL. SQL statements will generally use the newer engine, SQE, except in certain circumstances. The goal is to have the system use the SQE, which should perform better. One of the ways to facilitate this is to query just the physical file or table in an SQL statement, and let the system figure out which index it finds best to use. Using a logical file will result in the system using the CQE instead, which is less desirable from a performance perspective. Also, see these for some detailed info: <a href="http://www.itjungle.com/fhg/fhg040908-story01.html">http://www.itjungle.com/fhg/fhg040908-story01.html</a> <a href="http://itknowledgeexchange.techtarget.com/itanswers/progress400-with-db2400?asrc=EM_UGT_3964085&uid=5731771">http://itknowledgeexchange.techtarget.com/itanswers/progress400-with-db2400?asrc=EM_UGT_3964085&uid=5731771</a> Charles
Last Wiki Answer Submitted:  July 2, 2008  2:45 pm  by  Cwc   4,275 pts.
All Answer Wiki Contributors:  Cwc   4,275 pts. , philpl1jb   44,160 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _