One of the beautiful things about SQL is that it can be dynamic.

I never create views permanently unless there is a reason to. In this
situation, I would simply create the join or view in qtemp right in your
RPG program. In this way, you are never restricted to what you may have
created before.

Darryl.


On Fri, Jan 27, 2017 at 1:57 PM, Justin Taylor <JUSTIN@xxxxxxxxxxxxx> wrote:

That would work. The downside being we'd have to delete and recreate the
views when the underlying table was deleted.



-----Original Message-----
From: Mark S Waterbury [mailto:mark.s.waterbury@xxxxxxxxxxxxx]
Sent: Friday, January 27, 2017 10:52 AM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Override PF in view

Justin:

Suppose this is your original view:

Create view JOIN_VIEW as (
Select * from MYLIB.TABLE1 A
Join select * from MYLIB.TABLE2 B on A.ID = B.ID
Join select * from MYLIB.TABLE3 C on B.ID = C.ID
)

Now, create an alternate view that uses the "other" table (or PF), e.g.:

Create view JOIN_VIEW2 as (
Select * from MYLIB002.TABLE1A A
Join select * from MYLIB.TABLE2 B on A.ID = B.ID
Join select * from MYLIB.TABLE3 C on B.ID = C.ID
)

Then, you can issue:

OVRDBF FILE(JOIN_VIEW) TOFILE(JOIN_VIEW2)

and run your program or query as before, and that should do what you want
...

Hope that helps,

Mark S. Waterbury


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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.