About simple query

Jul 4, 2009 at 2:14 PM

hi,

i just want write a simple query like this

var q = from i in dc.SalesHeader

from a in dc.SalesLine

where i.SalesNo==a.SalesNo

select new {i.CustomerNo,a.ItemNo,a.UnitPrice};

this will generate somehting like this

select t0.CustomerNo,t1.ItemNo.t1.UnitPrice

from db0.SalesHeader t0

inner join SalesLine t1 on (t0.SalesNo=t1.SalesNo)

But i want to generate this

select t0.CustomerNo,t1.ItemNo.t1.UnitPrice

from db0.SalesHeader t0,SalesLine t1 

where (t0.SalesNo=t1.SalesNo)

because my database system doesn't support inner clause.

Please help

Cyril

 

Aug 13, 2009 at 2:52 PM

Hi Cyril,

What database system are you using? And which provider are you utilizing with it?

For example: the AccessQueryProvider has an alternate way of processing (Cross)Join queries so that they are written as: TableA t0, TableB t1.
There are quite a few Providers out there already.

Hope this helps,

~ Jos Krause

Aug 13, 2009 at 6:24 PM

Hi Jos,

I  developed my own provider for ODBC connections.

In fact, my implementation is derived of implementation  Sql server provider. In this implementation, only exists Left join and inner join SQL clause.

My odbc driver support left join but doesn't support inner join clause.

It can also support something like this

...

from db0.SalesHeader t0,SalesLine t1 

where (t0.SalesNo=t1.SalesNo)

...

But iqtoolkit can't manage to generate this.

Then I have to check with AccessQueryProvider if it's possible to do what i want.

Thanks for your response

Cyril