Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Filterexpressions: smaller issue with iEquals (LIKE vs =)

    Hi,

    SmartGWT version "v8.3p_2012-11-25".

    I'm using a data source feature where I defined the following field as filter:

    <field name="transactionId" type="text" length="32" nativeName="TX_ID" operator="iEquals" escapeHTML="true" />

    The query generated form the request containing the criteria:
    === 2012-12-07 12:31:51,502 [c-10] DEBUG RPCManager - Request #1 (DSRequest) payload: {
    criteria:{
    operator:"and",
    _constructor:"AdvancedCriteria",
    criteria:[
    {
    fieldName:"transactionId",
    operator:"iEquals",
    value:"111234"
    }
    ]
    },
    operationConfig:{
    dataSource:"dsTransaction",
    operationType:"fetch",
    textMatchStyle:"exact"
    },
    componentId:"isc_BasicSearchListGrid_0",
    appID:"builtinApplication",
    operation:"dsTransaction_fetch",
    oldValues:{
    operator:"and",
    _constructor:"AdvancedCriteria",
    criteria:[
    {
    fieldName:"transactionId",
    operator:"iEquals",
    value:"111234"
    }
    ]
    }
    }


    is generating a query like this:

    SELECT TX_ID, TX_AMOUNT
    FROM TRAN
    WHERE
    LOWER(TRAN.TX_ID) LIKE LOWER('111234')

    I would expect to have the following query created:

    SELECT TX_ID, TX_AMOUNT
    FROM TRAN
    WHERE
    LOWER(TRAN.TX_ID) = LOWER('111234')

    It this behavior a bug?

    What operator do I need to use in order to achieve the result above?

    Thanks,
    Liviu

    #2
    These two queries will return identical results. Can you explain why you consider the generated query to be incorrect?

    Comment


      #3
      Originally posted by Isomorphic View Post
      These two queries will return identical results. Can you explain why you consider the generated query to be incorrect?
      Hi,

      our db admin was not sure that the "LIKE" operator is executed the same way as "=" operator.
      After he did some measurement, gave us the recommendation to use "LIKE" operator.

      Further information can be found here:
      http://stackoverflow.com/questions/543580/equals-vs-like

      Thanks,
      Liviu

      Comment

      Working...
      X