Focal Point
[Closed] Multi-Field JOIN doesn't print child data

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4707047606

July 11, 2011, 04:59 PM
Rick Man
[Closed] Multi-Field JOIN doesn't print child data
When not all of the 'key' fields are printed then the dollar field does not print, but if all the key fields form the host flat file are printED then the dollar field prints coreectly.

Can somebody explain to me why this happens?
I can fix it, it is obvious, print the fields. It seems logical also to print the fields. Be that as it may why does it do that? I can guess. It loses it's pointer. But what is the real technical reason?

Interestingly another fix is to create the first file as a format focus file without an index and it will work.

Thanks, Rick


 
TABLE FILE CAR
PRINT 
BODYTYPE 
BY COUNTRY 
BY CAR 
BY MODEL 
IF RECORDLIMIT EQ 10
ON TABLE HOLD AS HOLD1
END
-*
DEFINE FILE CAR
JOINKEY/A50 = COUNTRY | CAR | MODEL;
END
TABLE FILE CAR
PRINT 
COUNTRY 
CAR 
MODEL
BODYTYPE DEALER_COST
BY JOINKEY
IF RECORDLIMIT EQ 10
ON TABLE HOLD AS HOLD2 FORMAT FOCUS INDEX JOINKEY
END
-*
JOIN COUNTRY AND CAR AND MODEL IN HOLD1 TO JOINKEY IN HOLD2 AS J1
TABLE FILE HOLD1
PRINT
COUNTRY
CAR
MODEL
DEALER_COST
END


 

This message has been edited. Last edited by: Rick Man,


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
July 12, 2011, 02:20 AM
Alan B
A multi-field JOIN from/to a fixed sequential data source is not supported. Only SQL/FOCUS, SQL/SQL, FOCUS/SQL and FOCUS/FOCUS will work.


Alan.
WF 7.705/8.007
July 12, 2011, 08:39 AM
Rick Man
I understand that. It's just that if I add the whole key fields to the PRINT statement it works. I'm curious why.


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
July 12, 2011, 10:27 AM
j.gross
Multi-field joins *from* a sequential data source are supported. For example, the join syntax and notes thereto in Creating Reports WithWebFOCUS Language (v. 7.6)(p. 685) specify no restrictions on the host, except for FOCUS files.

It may help if you post your exact code for the two scenarios.

Not that you have two COUNTRY columns in your JOIN structure (one in HOLD1, one in HOLD2); same for CAR and MODEL. See what happens when you omit COUNTRY CAR MODEL entirely from the first hold, or rename them, so that fieldnames are unique across the join.
July 12, 2011, 03:05 PM
Rick Man
Here's the code per your suggestion. That didn't help.
 SET ASNAMES=ON
TABLE FILE CAR
PRINT
BODYTYPE
BY COUNTRY
BY CAR
BY MODEL
IF RECORDLIMIT EQ 10
ON TABLE HOLD AS HOLD1
END
-*
DEFINE FILE CAR
JOINKEY/A50 = COUNTRY | CAR | MODEL;
END
TABLE FILE CAR
PRINT
COUNTRY AS 'CTRY'
CAR AS 'AUTO'
MODEL AS 'TYPE'
BODYTYPE DEALER_COST
BY JOINKEY
IF RECORDLIMIT EQ 10
ON TABLE HOLD AS HOLD2 FORMAT FOCUS INDEX JOINKEY
END
?FF HOLD2
-*
JOIN COUNTRY AND CAR AND MODEL IN HOLD1 TO JOINKEY IN HOLD2 AS J1
TABLE FILE HOLD1
PRINT
-*COUNTRY
-*CAR
MODEL
DEALER_COST
END 



Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF