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



If they are SQL views then yes you can create a view over it

For example:
CREATE VIEW COGNOSVIEW/ACTBALRCD AS (
SELECT BLACT1,C.STORENUMBER AS BLACT2,C.COSTCENTER AS BLACT3,
BLACT4,BALTYP,YEAR,PERIOD,BALNCE
FROM LIBD4201/IASCP032 A
LEFT JOIN WEBBUDGET/WEBASSIGN B
ON (TRIM(A.BLACT2) || TRIM(A.BLACT3)) =
TRIM(B.STORECODE)
LEFT JOIN WEBBUDGET/WEBASSIGN C
ON TRIM(B.ROLLUP) = TRIM(C.STORECODE)
WHERE BALTYP = '*ACTUAL'
AND BLACT1 BETWEEN '41000' AND '89999'
AND COMPNO = 1 AND PERIOD BETWEEN 1 AND 12
AND YEAR>=(YEAR(CURRENT DATE)-1)
AND (C.STORENUMBER IS NOT NULL)
AND (C.COSTCENTER IS NOT NULL)
) RCDFMT ACTBALRCDR;

CREATE VIEW COGNOSVIEW/ACTUAL12 AS (
SELECT A.*, CAST( ( A.YEAR * 100 ) + PERIOD AS INT ) AS PER_YEAR
FROM COGNOSVIEW/ACTBALRCD A
WHERE CAST( ( "YEAR" * 100 ) + PERIOD AS INT )
BETWEEN
CAST( DIGITS( YEAR( CURRENT_DATE - 1 YEAR ) ) AS INT ) * 100
-- + CAST( DIGITS( MONTH( CURRENT_DATE - 1 YEAR ) + 1 ) AS INT )
+ CAST( DIGITS( MONTH( CURRENT_DATE - 1 YEAR ) ) AS INT )
AND
CAST( DIGITS( YEAR( CURRENT_DATE ) ) AS INT )
* 100 + CAST( DIGITS( MONTH( CURRENT_DATE ) - 1 ) AS INT )
) RCDFMT ACT12R;


Thanks,
Tommy Holden



From: James Lampert <jamesl@xxxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 10/02/2012 11:35 AM
Subject: Joining to a join in SQL?
Sent by: midrange-l-bounces@xxxxxxxxxxxx



Consider this scenario:

You have a group of PFs, which in turn have a few LFs on them. You are
mainly doing native/RLA processing on them, but also some SQL, both
views and ad-hoc queries, all of which can potentially involve SQL
joins, and most of which involve programmatically-created SQL.

So far, so good.

But now, let's change the scenario:

Suppose you want to replace the PFs and LFs with join-logicals (or SQL
join-views), tying directly into data in other libraries.

But what about the aforementioned SQL views and queries, that involve
joins? Do they have to be built from the raw PFs? Or can they be built
on top of the existing joins?

--
JHHL

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.