phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bartłomiej Niemienionek <b.niemienio...@gmail.com>
Subject Phoenix LIKE operator with bind parameters question/error
Date Fri, 18 Nov 2016 13:28:35 GMT
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