[python-sybase] (forw) fetchall() error
Ashley Glassel
ashleyglassel at optushome.com.au
Fri, 7 Mar 2003 15:27:41 +1100
my apologies, for the lack of title in the last message.
----- Forwarded message from Ashley Glassel <ashleyglassel@optushome.com.au=
> -----
Date: Fri, 7 Mar 2003 15:25:13 +1100
From: Ashley Glassel <ashleyglassel@optushome.com.au>
To: python-sybase <python-sybase@object-craft.com.au>
Organisation: Poor
User-Agent: Mutt/1.2.5.1i
using code:
import Sybase
try:
s =3D Sybase.connect('Oscar', 'docent', 'docent')
cur =3D s.cursor()
cur.execute("select * from docent.DRUser where lastName =3D 'Glasse=
l'")
print cur.description
for tup in cur.description:
print tup[0],
print
while 1:
rec =3D cur.fetchall()
if not rec: break
print rec
except NameError,e:
print 'error ', e, 'undefined'
i get this error:
Traceback (most recent call last):
File "one.py", line 11, in ?
rec =3D cur.fetchall()
File "/usr/lib/python2.2/site-packages/Sybase.py", line 489, in fetchall
row =3D self.fetchone()
File "/usr/lib/python2.2/site-packages/Sybase.py", line 413, in fetchone
_array =3D _fetch_rows(self._cmd, self._bufs)
File "/usr/lib/python2.2/site-packages/Sybase.py", line 199, in _fetch_ro=
ws
raise Error('ct_fetch')
Sybase.Error: ct_fetch
the description part works, why can't I print the record??
-regards
Ashley=20
----- End forwarded message -----