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] Pass Global Temp Table logic to DB2 via WF

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Pass Global Temp Table logic to DB2 via WF
 Login/Join
 
Member
posted
I have SQL that I need to pass to a DB2 database via WebFOCUS. However, I do not know the FOCUS code that I need to put between the SQL statements. Can anyone help me determine where and what FOCUS code I need to include? Any help would be greatly appreciated.


Here is a mockup of the SQL I need to pass.


-* start code to connect to database
SQL DB2 SET SERVER CARSPROD1
SQL DB2
-* end code to connect to database


DECLARE GLOBAL TEMPORARY TABLE SESSION.CHNL
(CAR_N VARCHAR(64) ,
CARCODE VARCHAR(32),
CAR_I BIGINT )
WITH REPLACE NOT LOGGED
IN USER_TEMP ON COMMIT PRESERVE ROWS;


Insert into SESSION.CHNL
SELECT distinct A. CAR_N ,
A. CARCODE,
A. CAR_I
FROM CARTABLE A
WHERE a. CAR_I IN (123);


CALL ADMIN_CMD('RUNSTATS ON TABLE SESSION.CHNL');


SELECT w.sls_d,
w. CAR_I ,
Sum(w.SALE_AMT) AS sales,
Sum(w.TAX+_AMT) AS tax
FROM adw.SALES_TABLE w
INNER JOIN session.chnl x
ON x.CAR_I = w.CAR_I
WHERE w.sls_d BETWEEN '05/31/2012' AND '06/10/2012'
GROUP BY w.sls_d,
w.CAR_I ;

TABLE FILE SQLOUT
PRINT *
ON TABLE SET ONLINE-FMT EXL2K
END
-RUN
-EXIT

This message has been edited. Last edited by: Kerry,
 
Posts: 2 | Location: MN | Registered: August 29, 2005Report This Post
Expert
posted Hide Post
Hi Jennifer,

Not sure what you are using, but if it is from MRE, the following link may be of help:

How to run SQL Passthru to a remote Server via MRE?

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report 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] Pass Global Temp Table logic to DB2 via WF

Copyright © 1996-2020 Information Builders