Cursor is not open with firebird driver

590 views
Skip to first unread message

mariuz

unread,
Feb 11, 2011, 3:30:16 AM2/11/11
to web.py
I have a issue with the cursor seems that is not open by default when
doing a fetch

import web
db=web.database(dbn='firebird',db='localhost:/tmp/
test.fdb',user='sysdba',passwo
rd='masterkey')
result=db.select('barcamp')
print result[0]


python webpy_firebird.py
0.01 (1): SELECT * FROM barcamp
Traceback (most recent call last):
File "webpy_firebird.py", line 4, in <module>
print result[0]
File "/usr/local/lib/python2.6/dist-packages/web.py-0.34-py2.6.egg/
web/utils.py", line 652, in __getitem__
return self.i.next()
File "/usr/local/lib/python2.6/dist-packages/web.py-0.34-py2.6.egg/
web/db.py", line 616, in iterwrapper
row = db_cursor.fetchone()
kinterbasdb.ProgrammingError: (-504, 'fetch: \n Dynamic SQL Error\n
SQL error code = -504\n Invalid cursor reference\n Cursor is not
open')

Adrian Marius Popa

unread,
Oct 5, 2011, 9:01:34 AM10/5/11
to we...@googlegroups.com
it is now fixed if i add select into a transaction 


import web
db=web.database(dbn='firebird',db='localhost:/tmp/test.fdb',user='sysdba',password='masterkey')
#db.query("CREATE TABLE person (name varchar(255), email varchar(255))")
db.transaction()
result=db.query("select * from person")
#result=db.select('person')
print result[0]

python webpy_firebird.py 
0.01 (1): select * from person
<Storage {'NAME': 'NAME', 'EMAIL': 'EMAIL'}>


Reply all
Reply to author
Forward
0 new messages