?
Solved

SQLITE bind variable and LIKE operator

Posted on 2011-03-25
2
Medium Priority
?
1,582 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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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