I'm torn.  I wrote it this way because it bugs me to see alphabetical lists
sorted based on whether a letter is capitalized or not.  It would be great
if you could come up with a way that works in Interbase that works for other
db's.  But I do want the code in BasePeer to be db independent.

Can you add a DB method ignoreCaseInOrderBy() similar to toUpperCase()?  And
copy the code in the other DB adaptors from toUpperCase to
ignoreCaseInOrderBy().

This should not break anything, so I don't think it would bother anyone, but
maybe someone else sees a better solution.

John



----- Original Message -----
From: Leon Messerschmidt <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Tuesday, June 06, 2000 10:52 AM
Subject: Re: BasePeer Problem


> John,
>
> I wrote the DB adaptor for Interbase, and it does support UPPER, except in
> the ORDER BY clause.  I have no idea why this is so, for UPPER seems to
work
> fine _everywhere_ else.  Might be a bug in Interbase :-(.  Hopefully the
new
> opensource Interbase will solve my problems.
>
> In the mean time the only suggestion I could come up with is to remove
UPPER
> from the ORDER BY clause in BasePeer - except if my assumption that UPPER
> won't really make it difference is incorrect.
>
> Regards
> Leon
>
> ----- Original Message -----
> From: John McNally <[EMAIL PROTECTED]>
> To: Turbine <[EMAIL PROTECTED]>
> Sent: Tuesday, June 06, 2000 5:38 PM
> Subject: Re: BasePeer Problem
>
>
> > Sorry for my bad eyesight or laziness, but what DB adaptor does
Interbase
> > use.  You should make the patch there.  The reason for putting the
> > toUpperCase function in the DB interface was so that db dependent
methods
> > can be used.  If none exists you can just have it return the string.
> >
> > John
> >
> > ----- Original Message -----
> > From: Leon Messerschmidt <[EMAIL PROTECTED]>
> > To: Turbine <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 06, 2000 7:19 AM
> > Subject: BasePeer Problem
> >
> >
> > > Hi
> > >
> > > After the new DB class implementation I got the following exception:
> > >
> > > Exception: interbase.interclient.SQLException:
[interclient][interbase]
> > > Dynamic SQL Error
> > > SQL error code = -104
> > > Token unknown - line 1, char 147
> > > UPPER
> > >
> > > Later I found that the problem is that BasePeer adds an uppercase to
the
> > > order-by criteria.  In other words the query looks something like
this:
> > >
> > > SELECT COL1, COL2 FROM TABLE ORDER BY UPPER (COL3).
> > >
> > > Apparently some databases (Interbase for example) does not accept the
> > "ORDER
> > > BY UPPER".  I removed the uppercase from BasePeer (diff at the end)
and
> > the
> > > problem went away.  I assume that this will not influence the working
of
> > > BasePeer for ORDER BY probably does not need for the column to be
> > uppercase
> > > to yield the correct sequence.
> > >
> > > Let me know if my assumptions are wrong.
> > >
> > > Regards
> > > Leon
> > >
> > > diff -r1.23 BasePeer.java
> > > 789,796c789
> > > <                 if (  column.getType() instanceof String )
> > > <
> > >
> > > <
>                     orderByClause.add( db.toUpperCase(orderByColumn) );
> > > <                 }
> > > <                 else
> > > <                 {
> > > <                     orderByClause.add(orderByColumn);
> > > <                 }
> > > ---
> > > >                 orderByClause.add(orderByColumn);
> > >
> > >
> > >
> > >
> > > ------------------------------------------------------------
> > > To subscribe:        [EMAIL PROTECTED]
> > > To unsubscribe:      [EMAIL PROTECTED]
> > > Problems?:           [EMAIL PROTECTED]
> >
> >
> >
> > ------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Problems?:           [EMAIL PROTECTED]
> >
>
>
>
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to