Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I faced an issue with SQLite (version 3.7.13 if matters).

I created a new table with two columns foo and bar, data type is undefined. When I try to insert numbers, it works fine. When I insert text, "Error: no such column" happens.

sqlite> CREATE TABLE test (foo, bar);
sqlite> .tables
sqlite> insert into test values (0,1);
sqlite> select * from test;
sqlite> insert into test values (a,b);
Error: no such column: a

What am I doing wrong?

Thanks.

Or to use placeholders (e.g., ?) if executing the INSERT in a context that can supply the values more efficiently, such as any embedded use of SQLite (but not the sqlite shell IIRC). – Donal Fellows Feb 22, 2014 at 21:52

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.