|
There may be 20 jobs concurrently accessing the view. 19 want may want MYLIB.TABLE1, while 1 job wants MYLIB.TABLE1_2016. I guess I need to go back review alias, because I didn't think they could do that.
-----Original Message-----
From: Rob Berendt [mailto:rob@xxxxxxxxx]
Sent: Friday, January 27, 2017 10:25 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: Override PF in view
Looks doable
CREATE TABLE QTEMP.X (MYCOL CHAR (5 ) NOT NULL WITH DEFAULT) Table X created in QTEMP.
CREATE ALIAS QTEMP.XALIAS FOR QTEMP.X
Alias XALIAS created in QTEMP.
select * from qtemp.xalias
SELECT statement run complete.
create view qtemp.xview as (select * from qtemp.xalias) View XVIEW created in QTEMP.
select * from qtemp.xview
SELECT statement run complete.
drop alias qtemp.xalias
Drop of XALIAS in QTEMP complete.
CREATE ALIAS QTEMP.XALIAS FOR QTEMP.X
Alias XALIAS created in QTEMP.
select * from qtemp.xview
SELECT statement run complete.
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From: Justin Taylor <JUSTIN@xxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 01/27/2017 11:08 AM
Subject: RE: Override PF in view
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
Are you saying to replace the table in the view (e.g. MYLIB.TABLE1) with
an alias?
Sample:
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
)
Select *
From JOIN_VIEW
-----Original Message-----
From: Vernon Hamberg [mailto:vhamberg@xxxxxxxxxxxxxxx]
Sent: Thursday, January 26, 2017 4:30 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: Override PF in view
Hi Justin
I'll take a WAG at this. You probably all this, but ...
When you create a view, all you have is the SELECT statement encapsulated
in what is basically a logical file - with no data, no entries.
There is no connection to any kind of override when the view is used - the
SELECT statement is run at that time.
So maybe create an ALIAS and refer to that instead of the PF in the SELECT
statement.
Maybe???
Vern
As an Amazon Associate we earn from qualifying purchases.
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.