|
From: Ashley G. <ash...@ho...> - 2003-01-25 00:57:15
|
upgrade to sybase v.36pre3 and now I get these errors:
[root@the-box hash]# python
Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Sybase
>>> db = Sybase.connect('Oscar', 'docent', 'docent')
>>> c = db.cursor()
>>> c.execute("select * from docent.DRUser")
>>> c.fetchall()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/Sybase.py", line 490, in fetchall
row = self.fetchone()
File "/usr/lib/python2.2/site-packages/Sybase.py", line 410, in fetchone
_array = _fetch_rows(self._cmd, self._bufs)
File "/usr/lib/python2.2/site-packages/Sybase.py", line 196, in _fetch_rows
raise Error('ct_fetch')
Sybase.Error: ct_fetch
>>>
Any idea what is going wrong here?
It also doesn't matter if I use the c.fetchall() or c.fetchone()
thanks
Ashley
* Dave Cole (dj...@ob...) wrote:
>
> > more information. I am using freetds v0.60 and python-sybase v0.35
> >
> > [root@the-box db-stuff]# python
> > Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
> > [GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import Sybase
> > >>> db = Sybase.connect('Server', 'user','passwd')
> > >>> c = db.cursor()
> > >>> c.execute("select * from docent.DRUser where userID = '50970'")
> > >>> c.fetchall()
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in ?
> > File "/usr/lib/python2.2/site-packages/Sybase.py", line 489, in fetchall
> > row = self.fetchone()
> > File "/usr/lib/python2.2/site-packages/Sybase.py", line 409, in fetchone
> > _array = _fetch_rows(self._cmd, self._bufs)
> > File "/usr/lib/python2.2/site-packages/Sybase.py", line 193, in _fetch_rows
> > elif status in (CS_ROW_FAIL, CS_FAIL, CS_CANCELED,
> > NameError: global name 'CS_PENDING' is not defined
> > >>>
>
> FreeTDS does not define the CS_PENDING and CS_BUSY values. The quick
> fix for this problem is to delete all references to CS_PENDING and
> CS_BUSY from Sybase.py.
>
> 0.36pre2 does not use CS_PENDING or CS_BUSY in Sybase.py
>
> - Dave
>
> --
> http://www.object-craft.com.au
>
> _______________________________________________
> Python-sybase mailing list
> Pyt...@ob...
> https://object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase
----- End forwarded message -----
|
|
From: Dave C. <dj...@ob...> - 2003-01-25 08:09:49
|
> upgrade to sybase v.36pre3 and now I get these errors:
> [root@the-box hash]# python
> Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
> [GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import Sybase
> >>> db = Sybase.connect('Oscar', 'docent', 'docent')
> >>> c = db.cursor()
> >>> c.execute("select * from docent.DRUser")
> >>> c.fetchall()
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/usr/lib/python2.2/site-packages/Sybase.py", line 490, in fetchall
> row = self.fetchone()
> File "/usr/lib/python2.2/site-packages/Sybase.py", line 410, in fetchone
> _array = _fetch_rows(self._cmd, self._bufs)
> File "/usr/lib/python2.2/site-packages/Sybase.py", line 196, in _fetch_rows
> raise Error('ct_fetch')
> Sybase.Error: ct_fetch
> >>>
> Any idea what is going wrong here?
>
> It also doesn't matter if I use the c.fetchall() or c.fetchone()
Try doing this and post the debug output:
import Sybase
Sybase._ctx.debug = 1
db = Sybase.connect('Oscar', 'docent', 'docent')
c = db.cursor()
c.execute("select * from docent.DRUser")
c.fetchall()
- Dave
--
http://www.object-craft.com.au
|
|
From: Ashley G. <ash...@ho...> - 2003-01-25 20:26:44
|
ok turned on debugging and this is what i get:
[root@the-box db-stuff]# python
Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Sybase
>>> Sybase._ctx.debug = 1
>>> db = Sybase.connect('Oscar', 'docent', 'docent')
ct_con_alloc(ctx0, &conn) -> CS_SUCCEED, conn0
ct_con_props(conn0, CS_SET, CS_USERNAME, "docent", CS_NULLTERM, NULL) -> CS_SUCCEED
ct_con_props(conn0, CS_SET, CS_PASSWORD, "docent", CS_NULLTERM, NULL) -> CS_SUCCEED
servermsg_cb
servermsg_cb
ct_connect(conn0, "Oscar", CS_NULLTERM) -> CS_SUCCEED
ct_options(conn0, CS_SET, CS_OPT_CHAINXACTS, 1, CS_UNUSED, NULL) -> CS_SUCCEED
>>> c = db.cursor()
ct_cmd_alloc(conn0, &cmd) -> CS_SUCCEED, cmd0
.....
ct_bind(cmd0, 35, &datafmt34->fmt=[name:"msrepl_tran_version" type:CS_FORCE_CLOSE status:CS_FALSE
format:CS_FMT_UNUSED count:1 maxlength:16 scale:0 precision:0], databuf34->buff, databuf34->copied,
databuf34->indicator) -> CS_SUCCEED, databuf34
ct_describe(cmd0, 36, &fmt) -> CS_SUCCEED, datafmt35=[name:"careerModelID" type:CS_INT_TYPE
status:CS_FALSE format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0]
ct_bind(cmd0, 36, &datafmt35->fmt=[name:"careerModelID" type:CS_INT_TYPE status:CS_FALSE
format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0], databuf35->buff, databuf35->copied,
databuf35->indicator) -> CS_SUCCEED, databuf35
ct_describe(cmd0, 37, &fmt) -> CS_SUCCEED, datafmt36=[name:"countryID" type:CS_INT_TYPE
status:CS_FALSE format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0]
ct_bind(cmd0, 37, &datafmt36->fmt=[name:"countryID" type:CS_INT_TYPE status:CS_FALSE
format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0], databuf36->buff, databuf36->copied,
databuf36->indicator) -> CS_SUCCEED, databuf36
ct_describe(cmd0, 38, &fmt) -> CS_SUCCEED, datafmt37=[name:"careerCounselorID" type:CS_INT_TYPE
status:CS_CANBENULL format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0]
ct_bind(cmd0, 38, &datafmt37->fmt=[name:"careerCounselorID" type:CS_INT_TYPE status:CS_CANBENULL
format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0], databuf37->buff, databuf37->copied,
databuf37->indicator) -> CS_SUCCEED, databuf37
ct_describe(cmd0, 39, &fmt) -> CS_SUCCEED, datafmt38=[name:"myLTicket" type:CS_CHAR_TYPE
status:CS_CANBENULL format:CS_FMT_UNUSED count:1 maxlength:32 scale:0 precision:0]
ct_bind(cmd0, 39, &datafmt38->fmt=[name:"myLTicket" type:CS_CHAR_TYPE status:CS_CANBENULL
format:CS_FMT_UNUSED count:1 maxlength:32 scale:0 precision:0], databuf38->buff, databuf38->copied,
databuf38->indicator) -> CS_SUCCEED, databuf38
ct_describe(cmd0, 40, &fmt) -> CS_SUCCEED, datafmt39=[name:"userTicket" type:CS_CHAR_TYPE
status:CS_CANBENULL format:CS_FMT_UNUSED count:1 maxlength:32 scale:0 precision:0]
ct_bind(cmd0, 40, &datafmt39->fmt=[name:"userTicket" type:CS_CHAR_TYPE status:CS_CANBENULL
format:CS_FMT_UNUSED count:1 maxlength:32 scale:0 precision:0], databuf39->buff, databuf39->copied,
databuf39->indicator) -> CS_SUCCEED, databuf39
ct_describe(cmd0, 41, &fmt) -> CS_SUCCEED, datafmt40=[name:"subStatus" type:CS_CHAR_TYPE
status:CS_CANBENULL format:CS_FMT_UNUSED count:1 maxlength:1 scale:0 precision:0]
ct_bind(cmd0, 41, &datafmt40->fmt=[name:"subStatus" type:CS_CHAR_TYPE status:CS_CANBENULL
format:CS_FMT_UNUSED count:1 maxlength:1 scale:0 precision:0], databuf40->buff, databuf40->copied,
databuf40->indicator) -> CS_SUCCEED, databuf40
ct_describe(cmd0, 42, &fmt) -> CS_SUCCEED, datafmt41=[name:"businessUnit" type:CS_CHAR_TYPE
status:CS_CANBENULL format:CS_FMT_UNUSED count:1 maxlength:5 scale:0 precision:0]
ct_bind(cmd0, 42, &datafmt41->fmt=[name:"businessUnit" type:CS_CHAR_TYPE status:CS_CANBENULL
format:CS_FMT_UNUSED count:1 maxlength:5 scale:0 precision:0], databuf41->buff, databuf41->copied,
databuf41->indicator) -> CS_SUCCEED, databuf41
>>> c.fetchall()
ct_fetch(cmd0, CS_UNUSED, CS_UNUSED, CS_UNUSED, &rows_read) -> CS_ROW_FAIL, 0
ct_cancel(NULL, cmd0, CS_CANCEL_ALL) -> CS_SUCCEED
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/Sybase.py", line 490, in fetchall
row = self.fetchone()
File "/usr/lib/python2.2/site-packages/Sybase.py", line 410, in fetchone
_array = _fetch_rows(self._cmd, self._bufs)
File "/usr/lib/python2.2/site-packages/Sybase.py", line 196, in _fetch_rows
raise Error('ct_fetch')
Sybase.Error: ct_fetch
* Dave Cole (dj...@ob...) wrote:
>
> > upgrade to sybase v.36pre3 and now I get these errors:
>
> > [root@the-box hash]# python
> > Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
> > [GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import Sybase
> > >>> db = Sybase.connect('Oscar', 'docent', 'docent')
> > >>> c = db.cursor()
> > >>> c.execute("select * from docent.DRUser")
> > >>> c.fetchall()
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in ?
> > File "/usr/lib/python2.2/site-packages/Sybase.py", line 490, in fetchall
> > row = self.fetchone()
> > File "/usr/lib/python2.2/site-packages/Sybase.py", line 410, in fetchone
> > _array = _fetch_rows(self._cmd, self._bufs)
> > File "/usr/lib/python2.2/site-packages/Sybase.py", line 196, in _fetch_rows
> > raise Error('ct_fetch')
> > Sybase.Error: ct_fetch
> > >>>
> > Any idea what is going wrong here?
> >
> > It also doesn't matter if I use the c.fetchall() or c.fetchone()
>
> Try doing this and post the debug output:
>
> import Sybase
> Sybase._ctx.debug = 1
> db = Sybase.connect('Oscar', 'docent', 'docent')
> c = db.cursor()
> c.execute("select * from docent.DRUser")
> c.fetchall()
>
> - Dave
>
> --
> http://www.object-craft.com.au
>
> _______________________________________________
> Python-sybase mailing list
> Pyt...@ob...
> https://object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase
|