0

when i execute: dbObj.execSql("INSERT INTO table_name (col1,col2) VALUES(1,\"\") "); col2 is saved as NULL? or EMPTY STRING? OR WHAT!!!!!?

Because on retrieval it shows col2 is NULL, even when my table_name deifinition is:

CREATE TABLE table_name( col1 INTEGER, col2 VARCHAR(255) NOT NULL DEFAULT \"\");

4
  • stackoverflow.com/questions/17617610/… Commented Sep 15, 2015 at 10:40
  • Side note: The SQL string delimeter is ', not ". sqlite is quite lenient in this regard, but using " in place of ' is explicitly deprecated. Commented Sep 15, 2015 at 10:43
  • what are you trying to store in col2 exactly? Commented Sep 15, 2015 at 10:47
  • Show the code that retrieves the value. Commented Sep 15, 2015 at 11:43

1 Answer 1

1

No reason to scream. Your question is a little stupid. You insert an empty string. So obviously an empty string is saved.

SQLiteDatabase's method is "execSQL". "execSql" doesn't exist.

Maybe your code to read col2 is wrong...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.