cpython/Doc/includes/sqlite3/parse_colnames.py

11 lines
249 B
Python
Raw Normal View History

2007-08-15 11:28:22 -03:00
import sqlite3
import datetime
con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES)
cur = con.cursor()
cur.execute('select ? as "x [timestamp]"', (datetime.datetime.now(),))
dt = cur.fetchone()[0]
print(dt, type(dt))
con.close()