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 "McKinley (JIRA)" <em...@incubator.apache.org> on 2010/01/08 16:56:55 UTC

[jira] Reopened: (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 ]

McKinley reopened EMPIREDB-65:
------------------------------


I discovered that this is behaving correctly, but my column type was nvarchar on SQL Server 2005. nvarchar does not get converted to an Empire-db and therefore is treated as byte. In that case, by design and correctly, the LIKE expression will not be quoted. The solution is to cause the column in question to be evaluated as a string and something like EntityName.like(db.getValueExpr("%"+companyName+"%")) seems to help.

Can you please reopen and close this issue so that this comment appears to help people who find this?

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