Board index » jbuilder » How To Join Tables Without SQL?

How To Join Tables Without SQL?


2004-12-02 02:42:46 AM
jbuilder3
Does anyone know an easy way to join two tables without using SQL? I have 2
TableDataSets attached to TableDataFiles and I need to join then into a
single table.
Need to join the results of the follwing two M-D relationships:
DataSet1 = T1 (master) - T2 (detail)
DataSet2 = T1 (master) - T3 (detail)
Thanks.
 
 

Re:How To Join Tables Without SQL?

"GUI-Majician"
Quote
Does anyone know an easy way to join two tables without using SQL? I have
2
TableDataSets attached to TableDataFiles and I need to join then into a
single table.

Need to join the results of the follwing two M-D relationships:
DataSet1 = T1 (master) - T2 (detail)
DataSet2 = T1 (master) - T3 (detail)

Can you use a JdbTable without a DataSet and simply copy the Data from the
other DataSets into the Data of the JdbTable?
TableDataSet t1 = new TableDataSet( textDataFile1 );
TableDataSet t2 = new TableDataSet( textDataFile2 );
TableDataSet t3 = new TableDataSet( textDataFile3 );
t2.setMasterLink( t1 );
t3.setMasterLink( t1 );
JdbTable myJoinedTable = new JdbTable();
myJoinedTable.addData( t2.getData() );
myJoinedTable.addData( t3.getData() );
Or something to this effect.
 

Re:How To Join Tables Without SQL?

Well, a JdbTable can be used to display data from anything that is a
DataSet. So, your TableDataSet will work fine.
TableDataSet tds1 = new TableDataSet();
// load the data into your TableDataSet
JdbTable myTable = new JdbTable();
myTable.setDataSet(tds1);
As for your "join", that will work fine if you define you
MasterLinkDescriptor correctly. That is, you load your master data into
tds1, load the first level details into tds2, and then your third level
detail into tds3. If you set your MasterLinkDescriptors correctly, then the
dbSwing controls will automatically display the correct data.
However, I can't imagine how you plan to show the master-detail information
in a single JdbTable. I normally use multiple JdbTables for master-detail
displays.
Hope that helps you out,
David Sykes
"GUI-Majician" < XXXX@XXXXX.COM >wrote in message
Quote
"GUI-Majician"
>Does anyone know an easy way to join two tables without using SQL? I
>have
2
>TableDataSets attached to TableDataFiles and I need to join then into a
>single table.
>
>Need to join the results of the follwing two M-D relationships:
>DataSet1 = T1 (master) - T2 (detail)
>DataSet2 = T1 (master) - T3 (detail)
>
Can you use a JdbTable without a DataSet and simply copy the Data from the
other DataSets into the Data of the JdbTable?

TableDataSet t1 = new TableDataSet( textDataFile1 );
TableDataSet t2 = new TableDataSet( textDataFile2 );
TableDataSet t3 = new TableDataSet( textDataFile3 );
t2.setMasterLink( t1 );
t3.setMasterLink( t1 );
JdbTable myJoinedTable = new JdbTable();
myJoinedTable.addData( t2.getData() );
myJoinedTable.addData( t3.getData() );

Or something to this effect.


 

{smallsort}

Re:How To Join Tables Without SQL?

"David Sykes" < XXXX@XXXXX.COM >wrote in message
Quote
As for your "join", that will work fine if you define you
MasterLinkDescriptor correctly. That is, you load your master data into
tds1, load the first level details into tds2, and then your third level
detail into tds3. If you set your MasterLinkDescriptors correctly, then
the
dbSwing controls will automatically display the correct data.

However, I can't imagine how you plan to show the master-detail
information
in a single JdbTable. I normally use multiple JdbTables for master-detail
displays.

Hope that helps you out,
David Sykes

What I think I need is a new DataSet that combines the two detail DataSets.
I only need to match and display one column from each detail DS asside from
the M-D column of course.
Need:
DS4 = DDS2(COL X) + DDS3(COL X), where MDS1 is the Master of DDS2 and 3.
Can DataSets combine other DataSets? Or do I have to munge the models
together manually?
Thanks.