As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Here in the client they have an EDA/iWay connection to an AS400 DB2 database. I could use some SQL syntax to access this database, but not all syntax are supported.
According to another consultant, WebFOCUS is doing translation instead of passing the SQL directly to the database through the EDA/iWay connection. One of the limitation is that I can't use SQL sub-query. For example, If I want to select the price value of the last day in the table:
SELECT T1.SECURITY_ID, T1.PRICE, T1.TRADE_DATE FROM PRICE_TABLE T1 INNER JOIN (SELECT SECURITY_ID, MAX(TRADE_DATE) AS MAX_DATE FROM PRICE_TABLE GROUP BY SECURITY_ID) T2 ON T1.SECURITY_ID = T2.SECURITY_ID AND T1.TRADE_DATE = T2.MAX_DATE
There is this error:
(FOC1400) SQLCODE IS -205 (HEX: FFFFFF33) XOPEN: 42S22 (FOC1410) SQL COLUMN NOT FOUND. (FOR TABLE: CHECK ALIAS NAMES) L (FOC1405) SQL PREPARE ERROR. (FOC1400) SQLCODE IS 1400 (HEX: 00000578) : SQLCODE IS -205 (HEX: FFFFFF33) XOPEN: 42S22 L (FOC1405) SQL PREPARE ERROR.
Is there any document on this kind of SCALAR SQL? How to circumvent this sub-query issue?
Thanks!This message has been edited. Last edited by: <Kathryn Henning>,
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005
Does your SQL need to run on the remote EDA server?
We do that like this:
-SET &EDASERVER = 'AS400'; $ Your remote EDA server
-SET &EDACONN = 'SQL400'; $ The database connector on the EDA server
-SET &EDAAPP = 'SQLREPORTS'; $ An app on the EDA server to store the results
SQL EDA SET SERVER &EDASERVER
-RUN
-REMOTE BEGIN
APP HOLD &EDAAPP
ENGINE DB2 SET DEFAULT_CONNECTION &EDACONN
SQL DB2 PREPARE SQLOUT FOR
...Put your SQL query here...
END
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS YOURREMOTEHOLDFILE FORMAT FOCUS
END
-RUN
-REMOTE END
CREATE SYNONYM yourapp/YOURLOCALHOLDFILE
FOR YOURREMOTEHOLDFILE
DBMS EDA AT &EDASERVER
DROP
END
-RUN
Make sure you do all your sorting in the SQL query; doing that in the SQLOUT TABLE request can cause errors and agent crashes and probably isn't going to perform as well anyway.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
Then you're probably better off running the code against the remote EDA server like I showed.
That's using the -REMOTE BEGIN/END syntax.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
This works fine, but you have to re-write your sql to make it so:
SQL
SELECT
T2.*, T4.*
FROM
((SELECT
T1.*
FROM
whatever T1
) T2
INNER JOIN
(SELECT
SECURITY_ID,
MAX(somedate) AS SOMEDATE
FROM whatever T3
GROUP BY SECURITY_ID
) T4
ON
T2.someid = T4.SECURITY_ID AND
T2.somedate = T4.SOMEDATE
)
END
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott