Focal Point
getting Aggregation error-2590,91,94 while joining.

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

April 12, 2004, 11:32 PM
krishkasi
getting Aggregation error-2590,91,94 while joining.
Hi,
I am trying to join two master files created from SQL server tables.
Table A contains one primary key Key1.
Table B contains composite primary keys.Key1+Key2
I am writing a join condition as follows
Join
Key 1 in Table A to
Key 1 in table B as J0
end
Table file TableA
print *
end
Which retrieves records.But,swiching on the SQLTrace SET paramter(SET TRACEON=SQLAGGR//CLIENT) shows error 25901 and 25904 in the view source text file.

Can any one help me or explain me how exactly the joins are working and how to overcome this error.
April 12, 2004, 11:46 PM
TerryW
Kasi,

Because Table B has a composite key, then Key1 may occur multiple times, so you would have to either do

Join Key1 in TableA to ALL Key1 in TableB

or Use TableB instead of TableA and then ...

Join Key1 in TableB to Key1 in TableA

Your current situation may be retrieving some records, but it's only getting the first joined record and not all of them. Thus the keyword 'ALL'.

Good luck, TerryW
Cool
April 14, 2004, 11:43 PM
krishkasi
Terry
thank you so much.But I used ALL before looking into the reply.My need has become different-I need MATRIX.
I have 2 rows in table TABLE1 for the key KEYA and TABLEB contains the 3 rows for the same key KEYA.
Following is an Example:
TableA
----------
col1 col2
-----------------
keyA kasi
keyA abc
keyB xyz

TableB
--------
col1 col2
------------------
keyA admin
keyA user
KeyA tech

Now I want to join Table A and Table B in such a way that i can get 2x3 matrix.
I tried as follows
join
col1 in TableA to
col1 in tableB as j0
End
As well as
join
col1 in TableA to
All col1 in tableB as j0
End
I am getting FOC1070 or FOC1071 error.FROM or TO value in Join is out of range.
Even after interchanging the position of the TableA and TableB, i am getting the same error.
Any idea to form the MATRIX is really helpful.
April 15, 2004, 01:32 PM
suzy_smith
Both files need to be sorted (if they are flat files).
May 01, 2004, 06:20 PM
krishkasi
Hi,
No they are not flat files...
My data is available in an RDBMS..
I am having a common problem with the datawarehouse is the data are populated with Many to Many relationship in all the tables.

Consider an Employee attended various training programs.(Training table)consider it contains 4 records.EmpId & Course code are serogate keys.

The dates attended is in another table. Consider for the same course it contains multiple rows.(Timetable)-Consider it contains 9 rows.EmpId & Dt_course_attended & courseid are serogate keys.

How to join these?

Thanks..