Solved

SQLITE bind variable and LIKE operator

Posted on 2011-03-25
2
1,568 Views
Last Modified: 2012-05-11
Hi,
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?

Thanks
0
Comment
Question by:COMPSUPP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 125 total points
ID: 35220131
Try string concatentation:
select * from info where fg_ring like '%' || upper(?) || '%';

Open in new window

0
 

Author Closing Comment

by:COMPSUPP
ID: 35230844
Excellent, thanks for the Syntax
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question