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



First, for anyone who's curious about a <possible> future direction for 
'updatable views', plus some discussion on why they're such a problem to begin 
with, here's a link that introduces the idea of "INSTEAD OF triggers":

http://makeashorterlink.com/?Z64822C42
  or
http://www7b.software.ibm.com/dmdd/library/techarticle/0210rielau/0210rielau.html

Not quite ready for the iSeries, apparently, but DB2 Universal Database seems 
near a change.

As for Janell's problem, maybe it's simply a matter of realizing that '*INP' is 
the correct choice. This means that the create view will only be opened by the 
RPG program for input.

Janell, if you actually want to have your RPG program do output to the view, 
you won't be able to do it directly. You will need to add more file F-specs for 
the real files and do the output to those while the join view stays input-only 
to your program. But if you're just going to read the join view and maybe print 
a report, then '*INP' is still fine and no additional F-specs are needed.

Tom Liotta


rpg400-l-request@midrange.com wrote:

>  10. RE: OPNQRYF Question (Buck Calabro)
>
>Janell Haskins wrote:
>
>>I recently "discovered" OPNQRYF
>
>Welcome to the ranks!  Before I get too far, I want to point out that there
>are at least two FAQ entries on OPNQRYF.  Visit http://faq.midrange.com and
>use the search link in the lower left to search for OPNQRYF.  I hope there's
>some help in there.  I added Rob's links (thanks Rob!)
>
>
>As I was typing this, I see that Werner posted an excellent example of
>joining using OPNQRYF.  From an RPG perspective, using his example you would
>to define a F spec with SRQSHA as input.  The OVRDBF he shows re-directs the
>RPG program's I/O from SRQSHA to SRPSH.  SRPSH is the first file named on
>the FILE parameter of the OPNQRYF statement.
>
>>So here's my question, can I use OPNQRYF to
>>select the desired records [and update them].
>
>No.  A JOIN can't be updated.  Yet.  Maybe the DB2 team are working on that
>as we speak...  The way I handle this sort of thing is to do the join via
>OPNQRYF and declare another F spec where you would do your output/updating.
>Read from the primary (selected records only) file and CHAIN/SETLL/READE to
>the file you need to update.

--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertechgroup.com


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/


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.