problem with sql query, variable value not inserting itself.

Posted by Kaustubh on Stack Overflow See other posts from Stack Overflow or by Kaustubh
Published on 2010-03-27T10:03:37Z Indexed on 2010/03/27 10:13 UTC
Read the original article Hit count: 261

Filed under:
|

the old query works, the new on doesnt. the android logcat gives me error as: Failure 1: no such column abcname. abcname is the value of a editview that im trying to get from a popup in android.

================OLD QUERY:

MapsActivity.myDB.execSQL("INSERT INTO "
                            +MapsActivity.TableName
                            + " (name, user_comment, latitude, longitude) "
                            + " VALUES ('tagName','tagComment','tagLatitude','tagLongitude');");

================NEW QUERY:

MapsActivity.myDB.execSQL("INSERT INTO " +MapsActivity.TableName + " (name, user_comment, latitude, longitude) " + " VALUES ("+tagName +",'tagComment','tagLatitude','tagLongitude');");

what is the problem?

© Stack Overflow or respective owner

Related posts about sqlite

Related posts about android