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] how to join hold field with sql query

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] how to join hold field with sql query
 Login/Join
 
Gold member
posted
Hi All,
I am joining hold file with SQL query.
But I am not able to get the data ou to it.
Please find the below code
SQL
SELECT MIN(RD.COMGRP_GROUP_CODE) AS COMGRP_GROUP_CODE,
MIN(RD.COMGRP_DESC) AS COMGRP_DESC,
MIN(RD.COMMODITY_CODE) AS COMMODITY_CODE,
MIN(RD.COMMODITY_NAME) AS COMMODITY_NAME,
MIN(RD.REGION_CODE) AS REGION_CODE,
MIN(RD.REGION_NAME) AS REGION_NAME,
MIN(RD.PRODUCTLINE_CODE) AS PRODUCTLINE_CODE,
MIN(RD.PRODUCTLINE_DESC) AS PRODUCTLINE_DESC,
RD.PLANT_CODE,
MIN(RD.PLANT_NAME) AS PLANT_NAME,
RD.MST_CODE,
MIN(RD.SUPPLIER_NAME) AS SUPPLIER_NAME,
RD.RLDC_PART_NUMBER,
MIN(RD.PART_DESC) AS PART_DESC,
-* SUM(CEH1.EXCHANGE_RATE * RD.SPND * (1/CEH2.EXCHANGE_RATE)) AS SPND,
SUM(RD.QTY) AS QTY
FROM RECEIPTS_DTL RD
,
CURRENCY_EXCHANGE_HOLD CEH1,
CURRENCY_EXCHANGE_HOLD CEH2
WHERE
RD.YR = CEH1.YEAR
AND
CEH1.CURRENCY_CODE = '&SELECTED_CURRENCY'
AND RD.YR = CEH2.YEAR
AND RD.RLDC_CUR_CODE = CEH2.CURRENCY_CODE
GROUP BY RD.MST_CODE,
RD.RLDC_PART_NUMBER,
RD.PLANT_CODE;
TABLE ON TABLE HOLD AS HLD_PSR
END
Hold file :CURRENCY_EXCHANGE_HOLD
Can you please advice me how to resolve this issue.

Thanks,
Raghu

This message has been edited. Last edited by: Kerry,
 
Posts: 56 | Registered: February 04, 2010Report This Post
Gold member
posted Hide Post
I am getting following error.
0 NUMBER OF RECORDS IN TABLE= 248 LINES= 248
1
0 NUMBER OF RECORDS IN TABLE= 8 LINES= 8
0
1
0 NUMBER OF RECORDS IN TABLE= 248 LINES= 248
0
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Invalid root page
Thanks,
Raghu


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Report This Post
Expert
posted Hide Post
Where is the source of RECEIPTS_DTL ? is there a master file.

I guess there is, otherwise it would have errored.

Is there a reason to join to a HOLD file with SQL ? Wouldn't FOCUS be better ?


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
Gold member
posted Hide Post
Hi,
RECIPTS_DTL is database table.
CURRENCY_EXCHANGE_HOLD is hold file .
We need to dispaly some fields by joinig by above tables.
For your information it is working in version 767, recently we upgraded to 7611 after that the above query is not working.


Thanks,
Raghu


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Report This Post
Expert
posted Hide Post
Is your Hold file a FOCUS file or a flat file ?

It may work if the hold file is a FOCUS file with the appropriate columns indexed, or at least the hold file should be in the right order.


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
Gold member
posted Hide Post
The HOLD File is Coming from the other FOCUS FILE.
There we are putting as below.
TABLE FILE EXCH_DETAILS
PRINT *
BY CURRENCY_CODE NOPRINT
ON TABLE HOLD AS CURRENCY_EXCHANGE_HOLD
END

I am not aware how to indexing a column.
Can you please let me know how to indexing a column.

Thanks,
Raghu


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Report This Post
Expert
posted Hide Post
ON TABLE HOLD AS {file name} FORMAT FOCUS INDEX {column name column name}

Indexed column names must be 12 characters or less.

Format XFOCUS does not have this limit, but I think you need to be licensed for it.


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
Gold member
posted Hide Post
quote:
file name

Hi Waz,
Thanks for your Quick reply.
Since the hold file is using in some other Reports as well ,If i change any thing it will impact the other reports.
So can we make indexing in the below code.
SELECT MIN(RD.COMGRP_GROUP_CODE) AS COMGRP_GROUP_CODE,
MIN(RD.COMGRP_DESC) AS COMGRP_DESC,
MIN(RD.COMMODITY_CODE) AS COMMODITY_CODE,
MIN(RD.COMMODITY_NAME) AS COMMODITY_NAME,
MIN(RD.REGION_CODE) AS REGION_CODE,
MIN(RD.REGION_NAME) AS REGION_NAME,
MIN(RD.PRODUCTLINE_CODE) AS PRODUCTLINE_CODE,
MIN(RD.PRODUCTLINE_DESC) AS PRODUCTLINE_DESC,
RD.PLANT_CODE,
MIN(RD.PLANT_NAME) AS PLANT_NAME,
RD.MST_CODE,
MIN(RD.SUPPLIER_NAME) AS SUPPLIER_NAME,
RD.RLDC_PART_NUMBER,
MIN(RD.PART_DESC) AS PART_DESC,
-* SUM(CEH1.EXCHANGE_RATE * RD.SPND * (1/CEH2.EXCHANGE_RATE)) AS SPND,
SUM(RD.QTY) AS QTY
FROM RECEIPTS_DTL RD
,
CURRENCY_EXCHANGE_HOLD CEH1,
CURRENCY_EXCHANGE_HOLD CEH2
WHERE
RD.YR = CEH1.YEAR
AND
CEH1.CURRENCY_CODE = '&SELECTED_CURRENCY'
AND RD.YR = CEH2.YEAR
AND RD.RLDC_CUR_CODE = CEH2.CURRENCY_CODE
GROUP BY RD.MST_CODE,
RD.RLDC_PART_NUMBER,
RD.PLANT_CODE;
TABLE ON TABLE HOLD AS HLD_PSR
END

Thanks,
Raghu


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Report This Post
Expert
posted Hide Post
No I don't think you can.

But you could just add an extra TABLE FILE HOLD before the SQL and create a second HOLD file that is indexed.


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
Gold member
posted Hide Post
Hi Waz,
I tried as below but still i am getting error.
Please bare with my syntax if i written wrong since I am very new to Webfocus.
TABLE FILE CURRENCY_EXCHANGE_HOLD
PRINT CURRENCY_CODE
YEAR
EXCHANGE_RATE
ON TABLE HOLD AS CURR_EXCH FORMAT FOCUS INDEX CURRENCY_CODE YEAR EXCHANGE_RATE
-SQL
SELECT MIN(RD.COMGRP_GROUP_CODE) AS COMGRP_GROUP_CODE,
MIN(RD.COMGRP_DESC) AS COMGRP_DESC,
MIN(RD.COMMODITY_CODE) AS COMMODITY_CODE,
MIN(RD.COMMODITY_NAME) AS COMMODITY_NAME,
MIN(RD.REGION_CODE) AS REGION_CODE,
MIN(RD.REGION_NAME) AS REGION_NAME,
MIN(RD.PRODUCTLINE_CODE) AS PRODUCTLINE_CODE,
MIN(RD.PRODUCTLINE_DESC) AS PRODUCTLINE_DESC,
RD.PLANT_CODE,
MIN(RD.PLANT_NAME) AS PLANT_NAME,
RD.MST_CODE,
MIN(RD.SUPPLIER_NAME) AS SUPPLIER_NAME,
RD.RLDC_PART_NUMBER,
MIN(RD.PART_DESC) AS PART_DESC,
-* SUM(CEH1.EXCHANGE_RATE * RD.SPND * (1/CEH2.EXCHANGE_RATE)) AS SPND,
SUM(RD.QTY) AS QTY
FROM RECEIPTS_DTL RD,
CURR_EXCH CEH1,
CURR_EXCH CEH2
WHERE
RD.YR = CEH1.YEAR
AND
CEH1.CURRENCY_CODE = 'USD'
AND RD.YR = CEH2.YEAR
AND RD.RLDC_CUR_CODE = CEH2.CURRENCY_CODE
GROUP BY RD.MST_CODE,
RD.RLDC_PART_NUMBER,
RD.PLANT_CODE;
TABLE ON TABLE HOLD AS HLD_PSR
END
TABLE FILE HLD_PSR
PRINT *
END
-EXIT

Error Info :

0 TRANSACTIONS: TOTAL = 1 ACCEPTED= 1 REJECTED= 0
SEGMENTS: INPUT = 1 UPDATED = 0 DELETED = 0
0 NUMBER OF RECORDS IN TABLE= 248 LINES= 248
0 ERROR AT OR NEAR LINE 297 IN PROCEDURE vin_psr_receipts_r
(FOC002) A WORD IS NOT RECOGNIZED: SELECT
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLD_PSR
BYPASSING TO END OF COMMAND
-HTMLFORM END


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Report This Post
Expert
posted Hide Post
You are experiencing one of the problems of trying to learn WebFOCUS on the fly. What you are trying to do in your last post shows that you do not understand the use of SQL passthru, also what HOLDing data achieves and how HOLD files can be used.

Your best way forward would be to read the manual section relating to HOLD files and how they can be used. It is not an area that I would suggest you attempt to learn via the forum (not that you wouldn't be able to, just that it would be more expedient to read the manual).

An even better way forward would be to insist to your line management that a basic training course is paramount to enable you to begin to understand WebFOCUS.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Hi Tony,
By mistake i missed some code .
Sorry for that.

Thanks,
Raghu


WebFOCUS 7.6.7
Windows
Excel, PDF, HTML
 
Posts: 56 | Registered: February 04, 2010Report 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] how to join hold field with sql query

Copyright © 1996-2020 Information Builders