Solved

SQLITE bind variable and LIKE operator

Posted on 2011-03-25
2
1,547 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
2 Comments
 
LVL 59

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

773 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