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     [SOLVED] holding data retrieved using sqlora

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] holding data retrieved using sqlora
 Login/Join
 
Silver Member
posted
I am trying to hold data I retrieved using sqlora. If I just run the sql it returns in seconds, however when I add
TABLE
ON TABLE HOLD AS NEWDATA FORMAT ALPHA
END
it takes over 2 minutes to return. Does anyone know why? I query is returning approx 180,000 rows

This message has been edited. Last edited by: Kerry,


WebFOCUS 8105m
as well as 7.6.11
Windows 10
 
Posts: 33 | Registered: October 23, 2007Report This Post
Virtuoso
posted Hide Post
TABLEF (as opposed to TABLE) would speed things up: It avoids the process of forming an internal matrix containing all the 180,000 incoming rows; instead each incoming data row is immediately emitted as a row of the HOLD file, which potentially cuts the data-handling overhead by two-thirds.

First try changing TABLE to TABLEF:

TABLEF FILE SQLOUT
PRINT *
ON TABLE HOLD AS NEWDATA FORMAT ALPHA
END

If that is rejected [I am unsure whether the keyword TABLEF is allowed in this context], change it back to "TABLE" and add
SET AUTOTABLEF=ON before the SQLORA request. That should cause the TABLE request against SQLOUT to be treated like TABLEF, since you are not requesting TABLE to sort the data.

Of course you can and should first test on a smaller subset of the data.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Silver Member
posted Hide Post
I guess I should be a little clearer in what I am doing. Below is the code
SQL SQLORA
SELECT FA.QTY_N, FA.QTY_G, FA.COMP, FA.FAC_NO, FAH.AREA,
SUBSTR(FA.YEAR, 1,4) || SUBSTR(LPAD(FA.PER_NO, 2, 0), 1,2) YRMO,
FA.ACCOUNT || FA.SUB_FEAT ACSF,
TO_CHAR(GP.PER_START, 'YYYYMM') CALPERIOD,
SF.USER_CODE_01 SFCODE1
FROM TABLE1 FA,
TABLE2 GP,
TABLE3 GH,
TABLE4 GGD,
TABLE5 SF,
TABLE6 FAH
WHERE FA.COMP = GP.COMP
AND FA.YEAR = GP.YEAR
AND FA.PER_NO = GP.PER_NO
AND GGD.GROUP_CODE = '&COMPANY'
AND GGD.COMP = FA.COMP
AND GH.COMP = GGD.COMP
AND GH.COMP = FA.COMP
AND GH.COMP >= ' '
AND (TO_CHAR(GP.PER_START, 'YYYYMM') >= '&SELCALPER') AND (TO_CHAR(GP.PER_START, 'YYYYMM') <= '&SELCALPERA')
AND GH.OG_COMP = FAH.COMP
AND FA.FAC_NO = FAH.FAC_NO
AND GH.GL_COMP= SF.COMP
AND FA.ACCOUNT = SF.ACCOUNT
AND FA.SUB_FEAT = SF.SUB_FEAT
AND SF.SUB_FEAT >= ' '
AND SF.COMP >= ' '
AND SF.ACCOUNT >= ' ';
TABLE
ON TABLE HOLD AS NEWDATA FORMAT ALPHA
END
-RUN
if I put an exit in following the semi-colon it runs in about 1 second, otherwise it takes over 2 minutes.

Laura


WebFOCUS 8105m
as well as 7.6.11
Windows 10
 
Posts: 33 | Registered: October 23, 2007Report This Post
Expert
posted Hide Post
Laura,

It takes 1 second because it doesn't do anything, from WebFOCUS.

Have you tried:
 
SQL SQLORA PREPARE SQLOUT FOR
SELECT FA.QTY_N, FA.QTY_G, FA.COMP, FA.FAC_NO, FAH.AREA, 
SUBSTR(FA.YEAR, 1,4) || SUBSTR(LPAD(FA.PER_NO, 2, 0), 1,2) YRMO,
FA.ACCOUNT || FA.SUB_FEAT ACSF, 
TO_CHAR(GP.PER_START, 'YYYYMM') CALPERIOD, 
SF.USER_CODE_01 SFCODE1
FROM TABLE1 FA,
TABLE2 GP,
TABLE3 GH,
TABLE4 GGD,
TABLE5 SF,
TABLE6 FAH
WHERE FA.COMP = GP.COMP
AND FA.YEAR = GP.YEAR
AND FA.PER_NO = GP.PER_NO
AND GGD.GROUP_CODE = '&COMPANY'
AND GGD.COMP = FA.COMP
AND GH.COMP = GGD.COMP
AND GH.COMP = FA.COMP
AND GH.COMP >= ' '
AND (TO_CHAR(GP.PER_START, 'YYYYMM') >= '&SELCALPER') AND (TO_CHAR(GP.PER_START, 'YYYYMM') <= '&SELCALPERA')
AND GH.OG_COMP = FAH.COMP
AND FA.FAC_NO = FAH.FAC_NO
AND GH.GL_COMP= SF.COMP
AND FA.ACCOUNT = SF.ACCOUNT
AND FA.SUB_FEAT = SF.SUB_FEAT
AND SF.SUB_FEAT >= ' '
AND SF.COMP >= ' '
AND SF.ACCOUNT >= ' ';
END
-RUN
TABLE FILE SQLOUT PRINT *
ON TABLE HOLD AS NEWDATA FORMAT ALPHA
END
-RUN


You also have 5 INNER JOINs? Why wouldn't it take a couple of minutes.

What does it actually take when running the SQL by itself on ORACLE?

It "looks" like you need to create this as an aggregate table and use WebFOCUS to report from that...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Tom,

Actually, it's the WebFOCUS server that returns the data extracted by the data server to the web browser, so I wouldn't agree with "It takes 1 second because it doesn't do anything, from WebFOCUS". Why it should take a different amount of time to display the results on a web browser versus saving in a file on the server I can't explain.

Also, what's wrong with "5 INNER JOINs?" - I have dozens of WebFOCUS programs that generate SQL like that, taking from 1 second to 10 minutes to run, so the performance problem cannot be the number of inner joins.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
I tried using the TABLE FILE SQLOUT PRINT *
code from above but it didn't work.

My problem is not that is doesn't return the data but it is how long it is taking. By using -EXIT at several different locations, I was able to pinpoint where in the code the delay was. It happens when trying to save the data to a WebFocus table. When I run this same query using TOAD, it takes less than a second.

Thanks for trying to help.

Laura


WebFOCUS 8105m
as well as 7.6.11
Windows 10
 
Posts: 33 | Registered: October 23, 2007Report This Post
Expert
posted Hide Post
Laura, I understood from your original posting that it returned the data. Putting a -EXIT before the end of the code probably does not make the code run at all - you should be getting messages.

E.g., putting a -EXIT here will cause an error, because WebFOCUS expects an END statement (and that's why the program will take one second to run - it isn't doing anything except displaying an error message:

SQL SQLORA
SELECT FA.QTY_N, FA.QTY_G, FA.COMP, FA.FAC_NO, FAH.AREA,
SUBSTR(FA.YEAR, 1,4) || SUBSTR(LPAD(FA.PER_NO, 2, 0), 1,2) YRMO,
FA.ACCOUNT || FA.SUB_FEAT ACSF,
TO_CHAR(GP.PER_START, 'YYYYMM') CALPERIOD,
SF.USER_CODE_01 SFCODE1
FROM TABLE1 FA,
TABLE2 GP,
TABLE3 GH,
TABLE4 GGD,
TABLE5 SF,
TABLE6 FAH
WHERE FA.COMP = GP.COMP
AND FA.YEAR = GP.YEAR
AND FA.PER_NO = GP.PER_NO
AND GGD.GROUP_CODE = '&COMPANY'
AND GGD.COMP = FA.COMP
AND GH.COMP = GGD.COMP
AND GH.COMP = FA.COMP
AND GH.COMP >= ' '
AND (TO_CHAR(GP.PER_START, 'YYYYMM') >= '&SELCALPER') AND (TO_CHAR(GP.PER_START, 'YYYYMM') <= '&SELCALPERA')
AND GH.OG_COMP = FAH.COMP
AND FA.FAC_NO = FAH.FAC_NO
AND GH.GL_COMP= SF.COMP
AND FA.ACCOUNT = SF.ACCOUNT
AND FA.SUB_FEAT = SF.SUB_FEAT
AND SF.SUB_FEAT >= ' '
AND SF.COMP >= ' '
AND SF.ACCOUNT >= ' ';
-EXIT
TABLE
ON TABLE HOLD AS NEWDATA FORMAT ALPHA
END
-RUN

You should be getting an error message.

If you code this:
SQL SQLORA
SELECT FA.QTY_N, FA.QTY_G, FA.COMP, FA.FAC_NO, FAH.AREA,
SUBSTR(FA.YEAR, 1,4) || SUBSTR(LPAD(FA.PER_NO, 2, 0), 1,2) YRMO,
FA.ACCOUNT || FA.SUB_FEAT ACSF,
TO_CHAR(GP.PER_START, 'YYYYMM') CALPERIOD,
SF.USER_CODE_01 SFCODE1
FROM TABLE1 FA,
TABLE2 GP,
TABLE3 GH,
TABLE4 GGD,
TABLE5 SF,
TABLE6 FAH
WHERE FA.COMP = GP.COMP
AND FA.YEAR = GP.YEAR
AND FA.PER_NO = GP.PER_NO
AND GGD.GROUP_CODE = '&COMPANY'
AND GGD.COMP = FA.COMP
AND GH.COMP = GGD.COMP
AND GH.COMP = FA.COMP
AND GH.COMP >= ' '
AND (TO_CHAR(GP.PER_START, 'YYYYMM') >= '&SELCALPER') AND (TO_CHAR(GP.PER_START, 'YYYYMM') <= '&SELCALPERA')
AND GH.OG_COMP = FAH.COMP
AND FA.FAC_NO = FAH.FAC_NO
AND GH.GL_COMP= SF.COMP
AND FA.ACCOUNT = SF.ACCOUNT
AND FA.SUB_FEAT = SF.SUB_FEAT
AND SF.SUB_FEAT >= ' '
AND SF.COMP >= ' '
AND SF.ACCOUNT >= ' ';
END
-RUN

The data will be returned to the web browser window.

When you run the query using Toad, does it return the 180,000 rows in one second?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
I don't get an error when I put the exit following the semi-colon, I guess that is because SQL doesn't need to use END.

Yes, all 180,000 rows do get returned, but it only shows the first 500 at a time.


WebFOCUS 8105m
as well as 7.6.11
Windows 10
 
Posts: 33 | Registered: October 23, 2007Report This Post
Expert
posted Hide Post
It takes awhile to write 180K rows. Maybe you have slow disk. If you reduce the number of rows, does it run faster?

At any rate, it is something to investigate.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Silver Member
posted Hide Post
(solved) I've summarized the rows before returning them and it is faster, so I will go with this solution.


WebFOCUS 8105m
as well as 7.6.11
Windows 10
 
Posts: 33 | Registered: October 23, 2007Report 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     [SOLVED] holding data retrieved using sqlora

Copyright © 1996-2020 Information Builders