empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele (JIRA) <empire-db-...@incubator.apache.org>
Subject [jira] Closed: (EMPIREDB-65) like not quoting value properly and not quoting escape character properly on at least MSSQL and perhaps after 'and'
Date Sat, 26 Dec 2009 09:28:29 GMT

     [ 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.


Mime
View raw message