Use rawQuery() with ? placeholders rather than trying to concatenate everything yourself. Android and SQLite will properly quote and escape any strings as necessary.
On Fri, Jul 1, 2011 at 8:13 AM, NaveenShrivastva <[email protected]> wrote: > Sir my sql statement is > String sql = "insert into tblLocations (locType,locUrl,refUuid) > values ("+ > map.get("type").toString()+","+map.get("URL").toString()+","+refuuid+")"; > > getting value from hashmap then inserting .What is mistake hare .please help > me > > > > On Fri, Jul 1, 2011 at 5:40 PM, NaveenShrivastva > <[email protected]> wrote: >> >> Thx sir i am trying >> >> On Fri, Jul 1, 2011 at 5:33 PM, Mark Murphy <[email protected]> >> wrote: >>> >>> You need to quote your strings, as you do in just about every SQL >>> database ever invented. >>> >>> On Fri, Jul 1, 2011 at 7:56 AM, naveen kumar >>> <[email protected]> wrote: >>> > Caused by: android.database.sqlite.SQLiteException: unrecognized >>> > token: ":": , while compiling: insert into tblShows >>> > (shIcon,shSummary,shGenres,shName,shType,shUuid,localIcon) values >>> > (http://a725.phobos.apple.com/us/r1000/054/Video/e4/50/b7/mzl.qynukdwm. >>> > 133x100-99.jpg,,Comedy,30 Rock,tv,S00281,show_S00281.png) >>> > >>> > -- >>> > 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 >>> > >>> >>> >>> >>> -- >>> Mark Murphy (a Commons Guy) >>> http://commonsware.com | http://github.com/commonsguy >>> http://commonsware.com/blog | http://twitter.com/commonsguy >>> >>> _Android Programming Tutorials_ Version 3.5 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 >> >> >> -- >> Naveen Shrivastava >> BCA+MCA(LAST SEM)+O/A/B Level(DOEACC SOCITY IT GOVT INDIA) >> > > > > -- > Naveen Shrivastava > BCA+MCA(LAST SEM)+O/A/B Level(DOEACC SOCITY IT GOVT INDIA) > > -- > 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 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 3.5 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

