Definitely looks like a syntax error. Not sure the best solution as I
do not see an easy one.
John McNally
Chris Crossen wrote:
>
> Merry Christmas to anyone who isn't out doing last minute shopping.
>
> The following SQL is being generated by BasePeer:
> SELECT . . . .ORDER BY UPPER(Person.lastName DESC)
>
> if I use:
> criteria..addOrderByColumn("Person.lastName DESC")
>
> The correct syntax for MSSQL is:
> SELECT . . . .ORDER BY UPPER(Person.lastName) DESC
> or just
> SELECT . . . .ORDER BY Person.lastName DESC
> if case isn't significant.
>
> The problem appears to be in BasePeer line 938:
> orderByClause.add( db.ignoreCaseInOrderBy(orderByColumn) );
>
> This is being obscured by the fact that about half of the database
> adapters implement the ignoreCaseInOrderBy method by returning the
> passed string unchanged. So for example it won't happen with MySQL.
>
> I'm not sure how to fix this because I don't know if it is correct
> behavior for some databases but not others. I can hack around it by
> adding an ignoreCaseInOrderBy method to DBMSSQL that returns its input
> unchanged. But, if the generated syntax is incorrect, it would be
> better to fix it in BasePeer.
>
> Any of you database experts out there know if the generated syntax is
> correct for other databases?
>
> Thanks
> Chris
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]