Comment 4 for bug 217499

Revision history for this message
Yoan Blanc (greut) wrote :

$ sqlite3 temp.db
SQLite version 3.5.9
Enter ".help" for instructions
sqlite> CREATE TABLE persons (id INTEGER AUTO_INCREMENT, name VARCHAR);
sqlite> PRAGMA table_info('persons');
0|id|INTEGER AUTO_INCREMENT|0||0
1|name|VARCHAR|0||0

$ python
>>> import sqlite3
>>> conn = sqlite3.connect('temp.db')
>>> conn.execute("PRAGMA table_info('persons');").fetchall()
[(0, u'id', u'INTEGER AUTO_INCREMENT', 0, None, 0), (1, u'name', u'VARCHAR', 0, None, 0)]

it works for me?

>>> conn.execute("SELECT * FROM persons WHERE name=?;", ["greut"]).fetchall()
[(None, u'greut')]

but:

>>> conn.execute("SELECT * FROM '?' WHERE name='greut';", ["persons"]).fetchall()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
sqlite3.OperationalError: no such table: ?

? cannot be applied anywhere… I guess web.py don't have to find a workaround itself for this.