0
12-31 23:21:15.285: I/System.out(1609): onCreate SQL
12-31 23:21:15.535: I/System.out(1609): CREATE TABLE IF NOT EXISTS la_table (
12-31 23:21:15.535: I/System.out(1609):     _id INTEGER PRIMARY KEY AUTOINCREMENT, 
12-31 23:21:15.535: I/System.out(1609):     suggest_text_1 VARCHAR(100),
12-31 23:21:15.535: I/System.out(1609):     test_value_1 VARCHAR(100),
12-31 23:21:15.535: I/System.out(1609):     test_value_2 VARCHAR(100),
12-31 23:21:15.535: I/System.out(1609):     test_type_1 VARCHAR(50),
12-31 23:21:15.535: I/System.out(1609):     suggest_intent_data VARCHAR(5))
12-31 23:21:15.545: I/System.out(1609): INSERT INTO la_table VALUES(1,"Sodium (Na)","310 - 330 mg/dl",null,“Serum”,"1")
12-31 23:21:15.545: I/SqliteDatabaseCpp(1609): sqlite returned: error code = 1, msg = no such column: “Serum”, db=/data/data/com.assistant.lab.royale/databases/la_db

As you can see I'm creating a table la_table and inserting cetain values. I'm getting this error no such column: “Serum”. I'm really confused. I'm trying to insert "Serum" into column test_type_1 not "Serum".

0

1 Answer 1

2

This looks like a problem with your quotes. The around Serum are not standard.

Try with single quotes.

INSERT INTO la_table VALUES(1,'Sodium (Na)','310 - 330 mg/dl',null,'Serum','1')

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

3 Comments

I can't do that, I need to use ' in the values. How can I escape '?
Double them, for example the string Can't do that would be inserted as 'Can''t do that'.
It turned out to be a annoying feature of OpenOffice. OO uses “ instead of " (I'm editing the db using OO). Just replaced them and it works now. I'll accept your answer because I saw it because of your answer. Thanks. By the way SQLite handles double quotes just fine.

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.