phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: Phoenix LIKE operator with bind parameters question/error
Date Fri, 18 Nov 2016 16:09:10 GMT
Use :<number> instead, like this :1

Thanks,
James

On Fri, Nov 18, 2016 at 5:28 AM Bartłomiej Niemienionek <
b.niemienionek@gmail.com> wrote:

> Hi,
>
>
>
> I am trying to use Phoenix and I am facing some problems with LIKE
> operator when used in the prepared statement with bind parameters.
>
> I don’t know if this is some kind of known issue.
>
>
>
> *CREATE* *TABLE* TEST_TABLE (
>
>        NAME *VARCHAR*(100) *NOT* *NULL* *PRIMARY* *KEY*,
>
>        VAL *VARCHAR*(100)
>
>     );
>
>
>
> These are working fine:
>
> *SELECT* 1 *FROM* TEST_TABLE *WHERE* NAME = *:abc*;
>
> *SELECT* 1 *FROM* TEST_TABLE *WHERE* NAME = 'abc';
>
> *SELECT* 1 *FROM* TEST_TABLE *WHERE* NAME *LIKE* 'abc';
>
>
>
> Here I get error:
>
> *SELECT* 1 *FROM* TEST_TABLE *WHERE* NAME *LIKE* *:abc*;
>
>
>
> SQL Error [00000]: Error -1 (00000) : while preparing SQL: SELECT 1 FROM
> TEST_TABLE WHERE NAME LIKE ?
>
>   org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : while
> preparing SQL: SELECT 1 FROM TEST_TABLE WHERE NAME LIKE ?
>
>
>
> I am using phoenix driver in 4.9.0 version.
>
>
>
> Regards,
>
> bjn
>

Mime
View raw message