Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] EDA "Scalar SQL" limitation?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] EDA "Scalar SQL" limitation?
 Login/Join
 
Platinum Member
posted
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, 2005Report This Post
Expert
posted Hide Post
What is the code that is wrapped around your SQL ?

It should start with SQL DB2 to use SQL pass through.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by Waz:
What is the code that is wrapped around your SQL ?

It should start with SQL DB2 to use SQL pass through.


This is not like real DB2 SQL passthrough. They use

SQL EDA

Some DB2 function and SQL syntax is not supported, like "FETCH FIRST XXX ROWS".


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, 2005Report This Post
Virtuoso
posted Hide Post
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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by Wep5622:
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.


Still playing with this syntax, thanks for the advise Smiler


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, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] EDA "Scalar SQL" limitation?

Copyright © 1996-2020 Information Builders