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] Passing hold files values into a query one after the other.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Passing hold files values into a query one after the other.
 Login/Join
 
Member
posted
I am in need of some assistance.
Scenario:
I use a sql query to fetch some information like for example emp_id from emp table and I created a hold file (say SQL_DATA).
And in the same fex file I have another query wherein I need to pass emp_id (from the previous hold file SQL_DATA ) one at a time.

At present I’m preparing a string by concatenating all the emp id’s with a “,” and then passing one by one into the query using a loop and GETTOK. Looks is getting broken when we have more id’s. I need to know if there is any other way that we can do this much better and effectively. Thank you

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.7.05 and 8.x
Windows, All Outputs
 
Posts: 27 | Registered: December 13, 2012Report This Post
Guru
posted Hide Post
You don't need the string concatenation, you can loop while you are doing the read:
TABLE FILE EMPLOYEE
BY EMP_ID
ON TABLE HOLD
END
-RUN

-SET &NBREMPLOYEES = &LINES;
-REPEAT READEMPLOYEE &NBREMPLOYEES TIMES

-READFILE HOLD
-TYPE &EMP_ID -*Just for debugging purposes
...insert your query for each employee here

-READEMPLOYEE


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
 
Posts: 402 | Location: Upland, IN | Registered: June 08, 2012Report This Post
Master
posted Hide Post
There are multiple options available. One way is to convert your first query as subquery and use it directly in filter clause of second query. Other way is to use IN FILE option available in SQL, so that there is no need to read one by one and concatenate with comma separation.
Let me know if this works.

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Expert
posted Hide Post
Is the second query FOCUS code or SQL ?

You could join from the hold file to the second query.

With a HOLD file join to RDBMS tables, multiple queries are sent for each record in the hold file.

Without more information about the code you have, a good answer is difficult.


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
Member
posted Hide Post
@Ram - I cant use a sub query as the query has to get executed for each emp id seperatly.
@Waz - Both are sql queries.
@J - Option provided you seems to be working in my scenario.
When the loop run for 600 or so it is working fine and when it goes over 700 or so, it is showing "Task error: ERROR WRITING OUTPUT FILE: @0000057. No report to distribute." Do we need to make any settings change on the server. Please guide me. Thank all for your support.


WebFOCUS 7.7.05 and 8.x
Windows, All Outputs
 
Posts: 27 | Registered: December 13, 2012Report This Post
Virtuoso
posted Hide Post
Initial thought is that you could try setting agent_refresh=1 on the server. This has been know to help sometimes.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Guru
posted Hide Post
quote:
Task error: ERROR WRITING OUTPUT FILE: @0000057
Does it give you a line number? that makes it sound like it is erring out on the hold file, not the readfile. Maybe you could provide us with your code so we can get a better idea of what you are trying to do and why you need to use my method instead of the others.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
 
Posts: 402 | Location: Upland, IN | Registered: June 08, 2012Report This Post
Expert
posted Hide Post
The performance issue seems similar to something I had a while ago.

http://forums.informationbuild...587079106#8587079106

I would suggest creating a temporary table in the database and add that to your SQL query, so its one step, not hundreds.


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
Guru
posted Hide Post
Hi Prabhakar,

Just a thought, try once with NOCLOSE in READ command.


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report 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] Passing hold files values into a query one after the other.

Copyright © 1996-2020 Information Builders