Hi Balendra,

I made only minor corrections to your contributions and went ahead to
commit it.
Yes, let's also make an eobjects.org change ... I will do that now. Please
let me know if you face other MS SQL (or other in general) issues with
MetaModel. If not, we can consider a eobjects.org bugfix release as well.

Kasper


2014-05-30 11:24 GMT+02:00 Balendra Singh <[email protected]>:

> Hi,
>
> Yes Kasper. Changes are made in SQLServerQueryRewriter.java.
> I have submitted a patch to review at https://reviews.apache.org/r/22080/
> .
> Please review it.
> Are we going to commit these changes in eobjects as well ?
>
>
>
> Thanks,
> Balendra
>
>
> On 30 May 2014 13:55, Kasper Sørensen <[email protected]>
> wrote:
>
> > Yuck. I really dislike SQL Servers' "TOP n" prefix ... for this same
> reason
> > ... But whatever, we can't change that, so we better change our code :-D
> >
> > I think it sounds like an obvious bugfix in SQLServerQueryRewriter, quite
> > similar to the recent thing about datetime literals. Would you be able to
> > help again Balendra?
> >
> >
> > 2014-05-30 9:02 GMT+02:00 Balendra Singh <[email protected]>:
> >
> > > Hi,
> > >
> > > I am using MSSQL to fetch the records with max rows defined and
> distinct
> > as
> > > true also for the select clause as following -
> > >
> > > *Query q = new
> > > Query().from(table).selectDistinct().select(column).setMaxRows(20);*
> > >
> > > So it is throwing* Incorrect syntax near the keyword 'DISTINCT'* error.
> > > I debugged the code and found that
> > > in SQLServerQueryRewriter.rewriteSelectClause(), we are appending TOP
> 20
> > > after the select keyword so with distinct it becomes *select TOP
> > > 20 DISTINCT <rest query>* which is not correct.
> > > It should be *select DISTINCT TOP 20 <rest query>*.
> > >
> > > Please provide your input on this.
> > >
> > >
> > > Thanks,
> > > Balendra
> > >
> >
>

Reply via email to