[android-developers] Re: SQL Case Sensitivity between 2.1 and 2.2
Let me clarify that the problem is with SimpleCursorAdapter. Other
parts of DBHelper are not case sensitive. IOW, once I made a kludge
where the from string changes case depending on the database opened
accessing the database worked fine even if the fields were different
case. So try just open a database and try SimpleCursorAdapter with
different case fields. Will crash on 2.2 and not on 2.1 and earlier.
So unless you were working with SimpleCursorAdapter you might not have
seen this behavior. Example:
// where "c" is the Cursor
final SimpleCursorAdapter la = new SimpleCursorAdapter(this,
R.layout.atlasitem, c,
new String[] { "place","_id" } , new int[]
{ android.R.id.text1 } );
If the database field is "Place" then "place" won't work on 2.2
though it worked on 2.1 and earlier. You'll get an exception saying
the field "place" does not exist.
On Nov 8, 3:39 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Mon, Nov 8, 2010 at 5:48 PM, jtoolsdev <brianjto...@gmail.com> wrote:
> > Is there any reason why SQL became case sensitive with Froyo (2.2)?
>
> It isn't, AFAIK.
>
> > I was tracking down why I have an Error reported which doesn't occur
> > on my 2.1 phone nor on earlier OS version emulation with
> > SimpleCursorAdapter. My bad was that between two selectable databases
> > that one had lower case fields and the other that fields in
> > uppercase. Usually this would make no difference with SQL as it is
> > supposed to be case insensitive according to my investigations.
>
> It is. I demonstrate this by using _id and _ID interchangeably, for
> example, here:
>
> https://github.com/commonsguy/cw-android/tree/master/Database/Constants/
>
> This works fine with Android 2.2 -- I just ran it this morning.
>
> If you can come up with a sample project that demonstrates your case
> sensitivity issue, post the ZIP file somewhere for people to examine.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training in Atlanta:http://bignerdranch.com/classes/android
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home