You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Rainer Döbele (JIRA)" <em...@incubator.apache.org> on 2009/12/26 10:28:29 UTC

[jira] Closed: (EMPIREDB-65) like not quoting value properly and not quoting escape character properly on at least MSSQL and perhaps after 'and'

     [ https://issues.apache.org/jira/browse/EMPIREDB-65?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rainer Döbele closed EMPIREDB-65.
---------------------------------

    Resolution: Not A Problem

As Francis commented quoting depends on the underlying data type.
If the data type is TEXT, CHAR or CLOB escaping works correctly. Otherwise the behaviour is undefined.
Should you require to use the like operation with some other data type, you must convert it to a VarChar first.
e.g. like this

ecomp.EntityName.convertTo(DataType.TEXT).likeUpper("%"+companyName+"%");


> like not quoting value properly and not quoting escape character properly on at least MSSQL and perhaps after 'and'
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: EMPIREDB-65
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-65
>             Project: Empire-DB
>          Issue Type: Bug
>    Affects Versions: empire-db-2.0.6-incubating
>         Environment: MSSQL
>            Reporter: McKinley
>
> This will not wrap quotes aroung the like value:
> DBCompareColExpr lk = ecomp.EntityName.like("%"+companyName+"%");
> cmd.where(lk);
> This produces:
> where txx.SomeOtherThing = 'bar' and tXX.EntityName like %Foo% -- notice the lack of quotes!
> This may only be a problem when the like is added after an 'and'.
> This works:
> DBCompareColExpr lk = ecomp.EntityName.likeUpper("%"+companyName+"%");
> cmd.where(lk);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.