Hi,

I want to insert a String value call temp but I don't seems to get it
working for the INSERT INTO statement.
Anything wrong with the code?

This is the initialization to create table and insert some default
values into the table if the database doesn't exist.

Many Thanks.

---code---
  @Override
   public void onCreate(SQLiteDatabase db) {
      db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + _ID
            + " INTEGER PRIMARY KEY AUTOINCREMENT, " + FIELD1 + "
VARCHAR(1), " + FIELD2
            + " TEXT, " + FIELD3 + " TEXT, " + FIELD4 + " TEXT, " +
FIELD5 + " TEXT);");

      String tmp = "temp";
      db.execSQL("INSERT INTO " + TABLE_NAME + " VALUES (0 'A',
'Hello', '', " + temp + ", '');");
   }
---code---

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to