Join two tables without FK relations

Posts   
 
    
lgege
User
Posts: 27
Joined: 01-Sep-2005
# Posted on: 30-Sep-2005 17:52:10   

Hi,

I have two tables that don't have any Foreign Key relations. But I want to join them as long as certain fields match. The Sql is like

Select * from table1 t1 inner join table2 t2 where t1.field1=t2.field1 and t1.field2=t2.field2

I wonder whether this is possible. If so, how to do it? I want to use Adapter.

Thanks

Drewes
User
Posts: 67
Joined: 18-Aug-2003
# Posted on: 01-Oct-2005 02:36:13   

You can do this as follows: In LLBLGEN gui when you select an entity , right click the relation you can add a relation that does not exist in the database. That should do it.

Intersolve
User
Posts: 5
Joined: 14-Jul-2005
# Posted on: 07-Oct-2005 15:07:19   

Drewes wrote:

You can do this as follows: In LLBLGEN gui when you select an entity , right click the relation you can add a relation that does not exist in the database. That should do it.

But if you don't want add a relation to the database and just do a join on two tables for the fields I choose.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Oct-2005 15:38:34   

What Drewes suggests won't add a relation to the database, it will add a relation between the entities in the generated code. This can be used later for the joins.