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



This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
It's been some time since I've done any OPNQRYF programming, but I'll give
it a go.

When you swopped then files (Primary<->Secondary) did you change the OVRDBF
command too? You will also need to change the primary file in the RPG.

Thanks
Dennis Nel


Confidentiality Notice
This communication, its content and any file attachments transmitted
with it are intended solely for the addressee(s) and may contain
confidential proprietary information. Access by any other party without
the express written permission of the sender is unauthorised. If you
have received this communication in error you may not copy, distribute
or use the contents, attachments or information in any way. Please
destroy it and contact the sender.



-----Original Message-----
From: Richard B Baird [mailto:rbaird@esourceconsulting.com]
Sent: 04 February 2002 09:55
To: midrange-l@midrange.com
Subject: opnqryf question - opnid, joins, overides, etc.



hey all,

I've got a question.  given the following code:

OVRDBF     FILE(FILE1) TOFILE(MYLIB/FILE1) SHARE(*YES)
OVRDBF     FILE(SELCOPY) TOFILE(QTEMP/SELCOPY) SHARE(*YES)

OPNQRYF    FILE((MYLIB/FILE1) (QTEMP/SELCOPY)) +
             FORMAT(MYLIB/FILE1 *ONLY) +
             KEYFLD((*MAPFLD/F1FLD1) (*MAPFLD/F1FLD2)) +
             JFLD((*MAPFLD/F1FLD1 *MAPFLD/F2FLD1 *EQ)  +
                  (*MAPFLD/F1FLD2 *MAPFLD/F2FLD2 *EQ)) +
             MAPFLD((F1FLD1    'FILE1/FLD1    ')  +
                    (F1FLD2    'FILE1/FLD2    ')  +
                    (F2FLD1    'SELCOPY/FLD1  ')  +
                    (F2FLD2    'SELCOPY/FLD2  '))  +
             OPNID(FILE1)

I'm trying to select certain records from FILE1 (over 1M records) by
joining it to SELCOPY (only a reletive few) - outputing to the format of
FILE1, so my RPG program can read it.  the override works nicely to let the
RPG see the results of the query.  The query runs fine but is VERY slow.

Long story, but I don't have an existing access path to locate the records
from file 1 using setll/reade, and I'm not allowed to build logicals over
these files.  I do not have SQL (other than query manager) available.

Now, finally, to my real problem:

I tried reversing the order of the files in the join:

OPNQRYF    FILE((QTEMP/SELCOPY) (MYLIB/FILE1) ) + ....

thinking that because it had only a few records it might build the access
path more efficiently and run faster.

the query still runs, and it appears that it builds the access path more
quickly than the other way around.  but now I've lost the opnqryf/rpg
connection.  the rpg is reading the the whole of FILE1, not the subsetted
records from the opnqryf, even though the override is still in place, and
i've named my OPNID the same.

any ideas?  Thanks,

Rick

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


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.