Solved

SQLITE bind variable and LIKE operator

Posted on 2011-03-25
2
1,533 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now