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



On 9/18/2013 12:54 PM, Darryl Freinkel wrote:

I have a program that reads File_A which has multiple members.

There is a CL program before the SQLRPGLE program that does a OVRDBF FILE_A
to member B. In the program, I use a SQL SELECT to total up the balance on
an invoice which is SUMed against member A.

I create an ALIAS - CREATE ALIAS QTEMP/FILE_A_A for LIB/FILE_A(A) in the RPG
program.

In the program, I do a SELECT sum(AMT) from QTEMP/FILE_A_A.

Problem:

When the OVRDBF is used, the SELECT does not find the records. It seems to
be looking at member B in File_A.

When I remove the OVRDBF, the SELCT works as designed.

Does anyone know what the problem is and how to work around the issue?

If I understand it right, you have an F spec and an SQL SELECT that you
want to point to two separate members. OVRDBF does indeed affect SQL as
well as RPG native opens, so what you see is what's supposed to happen.

Way back when (before SQL) I had a similar problem; needed two F specs
pointing to the same file but different members. I did something like:

FFILE_A_A IP
FFILE_A_B UF

OVRDBF FILE_A_A FILE_A MBR(A)
OVRDBF FILE_A_B FILE_B MBR(B)

CALL RPGPGM

--buck


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.