Thursday, 8 August 2013

Open Query(OPNQRY) and Override with Database File(OVRDBF) concept

You can use the Override with Database file (OVRDBF) command to replace the database file named in a CL program or to change certain parameters of the existing database file.
It is not mandatory to use OVRDBF(*Yes) before OPNQRYF. You can still use OPNQRYF without OVRDBF.But here the pupose of the OPNQRYF won't be solved.
Opnqryf creates its own Open data path and to share the same data path in a program we use ovrdbf share(*yes), if we do not use ovrdbf, then program will have its own ODP, so it will read the file from beginning on which query has been run. So, OPNQRYF selected records will have no importance.
So, we need to use CPYFRMQRYF command and put the selected records in to runtime file and use that file to read in program.


No comments:

Post a Comment