× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Prevesh.Kuni wrote:

Is it possible to programmatically change the file selection
library in a *QRYDFN?

We have hundreds of queries where a file library needs to change....

I have done passing parms to a QMQRY but these are existing *QRYDFN

Any help would be greatly appreciated - thanks


Except by traversing the panels of the interactive WRKQRY 2=Change, there is no supported and trusted way to change the input files named in a Query Definition object. Consider converting the queries to QMQRY and QMFORM if that method is familiar; QM uses SQL Query Engine [SQE] instead of the Classic Query Engine [CQE], and it is more flexible than what Query/400 offers, in part at least, because it compiles from source rather than only having an interactive prompted interface.

Even if the object could be modified directly by some user code, more would need to be done [in many cases]. The additional work would be to /recompile/ after the change, which is accomplished by using 2=Change, F3=Exit, and then 1=Save from WRKQRY. A change to the system-domain object type *QRYDFN [which is restricted to system-state code] would be similar to changing some compiled code, whereby having done so without full realization of the possible subtle ramifications might cause problems; e.g. optimizations for which the change would not be /visible/ to the run-time, thus the changed binary would produce incorrect or unpredictable results.

The product design was such that the OS-supplied commands RUNQRY with QRYFILE() and OVRDBF with TOFILE() would enable run-time override to the file [library]; those can be put to use as intended. If those are not sufficient, such that the objects must be changed for some reason, then to save having a person do the manual interactive actions to effect a recompile of the object, screen scraper macros and screen API coding can be used to manipulate a workstation session to [perform the keystrokes that would] change a list of query definitions [presented by F4=Prompt and optionally a generic subset] interactively. As alluded earlier, this type of interactive navigation [to effect recompile] would still be a\[an effective] requirement, even if the library name stored in the object could be modified directly.

http://groups.google.com/group/it.comp.as400/msg/60cd82649761f92d

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.