Hamy wrote:
> Could someone please help me spot the bug here? Mainly, I can never
> seem to find a value once it has been stored in the database (I am
> 100% positive that the value is there). I can store it the first time,
> but the cursor in my findVenue() method (see below) never has any
> data. :-(
>
> If I do not try to use replaced ? marks, and instead write a raw
> string that is then used as my query, it works perfectly. It does not
> work with prepared statements. I would really like to use the ? marks
> to help avoid SQL security issues (and I am frustrated that they do
> not work). Also, I would like to be able to see the text of my SQL
> query somewhere before I execute it, if that is possible.
<snip>
> StringBuffer sql = new StringBuffer("SELECT " +
> Columns.COLUMN_ID
> + " FROM " + Tables.VENUES + " WHERE ?=?");
Try only using a ? on the right-hand side and see if it works for you.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
_Android Programming Tutorials_ Version 0.95 Available!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---