1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
import datetime, decimal, os.path, string, sys
import kinterbasdb
kinterbasdb.init(type_conv=200)
# This program never imports mx.DateTime:
assert 'mx' not in sys.modules
con = kinterbasdb.connect(dsn='xxxx', user='toto', password='bababa')
#ok
# Create a Cursor object that operates in the context of Connection con:
cur = con.cursor()
#ok
# Execute the SELECT statement:
cur.execute("select * from table01")
# erreur
"""
cur.execute("select * from table01")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
kinterbasdb.OperationalError: (-901, 'begin transaction: \n invalid parameter in transaction parameter block')
"""
# Retrieve all rows as a sequence and print that sequence:
print cur.fetchall()
# jamais atteint |
Partager