Re: DB2 Adapter Problem

From: Holger Hoffstätte (holge..izards.de)
Date: Wed Jun 04 2003 - 09:00:38 EDT

  • Next message: Andrus Adamchik: "Re: DB2 Adapter Problem"

    Coming back to an older issue with the DB2 adapter:

    > Mario.Link..fi-lsa.de wrote:
    >
    > > if i want to use the: Expression.LIKE_IGNORE_CASE
    > > is the result: WHERE UPPER(name) LIKE UPPER(?)
    > > from the QualifierTranslator.
    > >
    > > DB2 write a SQLException with the error-code SQL0418N.
    > > This indicating an invalid use of a parameter marker.
    >
    > > The solution is:
    > > WHERE UPPER(name) LIKE UPPER(CAST(? AS VARCHAR (100)))
    >
    > > Question:
    > > How can this insert in the QualifierTranslator-class and
    > > how can make VARCHAR-size dynamic (not 100).

    I have now hit exactly this problem and Mario was right: the eror occurs
    with bind variables. In my mail I suggested a look at QualifierTranslator
    and TrimmingQualifierTranslator but this proved to be less helpful than I
    expected because (I think) the processColumn method in QualifierTranslator
    does 'too much' and cannot easily be overridden to provide the necessary
    CAST .. AS VARCHAR conversion. I tried to wedge
    willProcessColumn/didProcessColumn methods in there but it's still too
    early. The only way around this that I can see would be a full
    duplication, which would not be acceptable, IMHO.
    Andrus, do you see any other way around this that I've been missing? The
    entire QueryAssembler/Helper setup is somewhat confusing, and I didn't
    find the right place to wedge into..

    Btw, I think this is the only reason for any left unit test failures. :)

    Holger



    This archive was generated by hypermail 2.0.0 : Wed Jun 04 2003 - 08:59:36 EDT