SQLITE bind variable and LIKE operator

I am calling a bind variable in SQLITE using the following:

select * from info where fg_ring = ?

Open in new window

But I would like to get the results of the following:

select * from info where fg_ring like '%upper(?)%'

Open in new window

Unfortunately, I can't get it to work - error I am getting is:

03-25 12:23:53.309: ERROR/AndroidRuntime(2769): Caused by: android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x2e13c8

Even if I remove the upper() function, it's still not working. Anyone have any hints on how to get this? Or is it set in stone that bind can only work with "=" operator?

Who is Participating?
Kevin CrossConnect With a Mentor Chief Technology OfficerCommented:
Try string concatentation:
select * from info where fg_ring like '%' || upper(?) || '%';

Open in new window

COMPSUPPAuthor Commented:
Excellent, thanks for the Syntax
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.