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.
Hi All, I'm using the SQL passthrough and I want the following SELECT in a single request.
SELECT SUM(P_LOSS) FROM TABLE1 WHERE (DATE_1 >= 200701) AND (DATE_1 <=200712) -*********************** SELECT SUM( EXP) FROM TABLE1 WHERE (DATE_1 <=200712). -**************************** I want to achieve the above in a single SELECT as to avoid the HOLD files.
I thought I might have a little fun with your code Francis. This is the focus code that is generated from you sql union. Some things just seem to become more complex than they need to be sometimes.
****************************************************
*** SQLTRANS trace level 1 - Generated DML ***
****************************************************
SET COUNTWIDTH=ON
-SET SQLERRNUM = 0;
TABLE FILE CAR.COUNTRY
WRITE
MIN.COUNTRY
MIN.MODEL
BY COUNTRY NOPRINT BY MODEL NOPRINT
WHERE ( COUNTRY EQ 'FRANCE' ) ;
ON TABLE SET CARTESIAN ON
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS SQLFIL01
END
-RUN
-IF &SQLERRNUM GT 0 GOTO SQLEXT01;
-SET SQLERRNUM = &FOCERRNUM;
-IF &RETCODE GT 1 GOTO SQLEXT01;
-IF &RETCODE LT 0 GOTO SQLEXT01;
-IF &FOCERRNUM GT 0 GOTO SQLEXT01;
TABLE FILE CAR.COUNTRY
WRITE
MIN.COUNTRY
MIN.MODEL
BY COUNTRY NOPRINT BY MODEL NOPRINT
WHERE ( COUNTRY EQ 'ENGLAND' ) ;
ON TABLE SET CARTESIAN ON
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS SQLFIL02
END
-RUN
-IF &SQLERRNUM GT 0 GOTO SQLEXT01;
-SET SQLERRNUM = &FOCERRNUM;
-IF &RETCODE GT 1 GOTO SQLEXT01;
-IF &RETCODE LT 0 GOTO SQLEXT01;
-IF &FOCERRNUM GT 0 GOTO SQLEXT01;
MATCH FILE SQLFIL01
BY E01 BY E02
RUN
FILE SQLFIL02
BY E01 BY E02
AFTER MATCH HOLD AS SQLFIL03 OLD-OR-NEW
END
TABLE FILE SQLFIL03
PRINT E01 E02
END
Windows: WF 7.6.2: SQL Server 2008 R2
Posts: 86 | Location: Chicago | Registered: August 03, 2007
If you need the information as a single record, you could try the following.
SQL enginename
SELECT P_LOSS, EXP
FROM
(SELECT SUM(P_LOSS) 'P_LOSS'
FROM TABLE1
WHERE (DATE_1 >= 200701)
AND (DATE_1 <= 200712) A,
(SELECT SUM(EXP) 'EXP'
FROM TABLE1
WHERE DATE_1 <= 200712) B;
END
Windows: WF 7.6.2: SQL Server 2008 R2
Posts: 86 | Location: Chicago | Registered: August 03, 2007