× 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.



Has anyone experienced embedded SQL ignoring an OVRDBF and updating the wrong file?

We have a CL program CLMAIN that contains conceptual code like this:

CPYF A_FILE to A_FILEX *REPLACE
OVRDBF A_FILE to A_FILEX
CALL RPG_A
CALL RPG_B
CALL RPG_C
Etc.
DLTOVR *ALL
RETURN

Program RPG_C is SQLRPGLE. It opens a cursor over A_FILE for UPDATE of a couple of fields.

It iterates over the cursor conditionally doing “Update A_FILE set field = value WHERE CURRENT OF …”. This should update A_FILEX because of the OVRDBF.

<<Occasionally>> an execution of program RPG_C updates A_FILE instead of updating A_FILEX. I have determined this by analyzing the journal records. So far I have failed to recreate the situation in a test environment--A_FILEX gets updated as expected.

I’m clutching at straws here, wondering if the SQL runtime is occasionally missing the OVRDBF.

I don’t see how the OVRDBF could be removed, except by the DLTOVR at the end of the program. The programs in CLMAIN run in the default activation group so the OVRDBF is scoped to the call level. Some of the programs use SQL, often with a mix of native IO. Some call CL programs that may do overrides, but those overrides would be at a different call level than CLMAIN and I can’t see how they could effect it.

CLMAIN is invoked from an RPG III menu program, probably via QCMDEXC. CLMAIN can be run again and again from the menu, or may be executed interspersed with execution of other menu programs.

We are on V6R1, but not up to date on PTFs.

Sam

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.