$ 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
>>> 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.
$ sqlite3 temp.db 'persons' );
SQLite version 3.5.9
Enter ".help" for instructions
sqlite> CREATE TABLE persons (id INTEGER AUTO_INCREMENT, name VARCHAR);
sqlite> PRAGMA table_info(
0|id|INTEGER AUTO_INCREMENT|0||0
1|name|VARCHAR|0||0
$ python connect( 'temp.db' ) "PRAGMA table_info( 'persons' );").fetchall( )
>>> import sqlite3
>>> conn = sqlite3.
>>> conn.execute(
[(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( ) OperationalErro r: no such table: ?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
sqlite3.
? cannot be applied anywhere… I guess web.py don't have to find a workaround itself for this.