[python-sybase] Sybase.py with MSSQL and BIGINT (8 byte integer) datatype Supported???

Paul Rensing paulrensing at verizon.net
Fri Sep 9 12:36:16 EST 2005


Bradley,

I had this same problem. I patched the code, but just for reads (I don't
need to write those values). I have attached the patch file. 

Dave Cole, can we get these into the repository?

	Paul Rensing

On Mon, 2005-08-29 at 17:05 -0400, Bradley Feldman wrote:
> Does not seem so....  Anyone have any ideas for a quick patch?   Right now
> I'm typecasting back done to int type (4 byte).
> 
> Thanks,
> 
> *Bradley
> 
> Here's the traceback:
> 
>   File "/usr/lib/python2.4/site-packages/Sybase.py", line 392, in start
>     return _FetchNow.start(self, arraysize)
>   File "/usr/lib/python2.4/site-packages/Sybase.py", line 324, in start
>     self._row_result()
>   File "/usr/lib/python2.4/site-packages/Sybase.py", line 345, in
> _read_result
>     while _fetch_rows(self._cmd, bufs, logical_result):
>   File "/usr/lib/python2.4/site-packages/Sybase.py", line 267, in
> _fetch_rows
>     rows.append(_extract_row(bufs, 0))
>   File "/usr/lib/python2.4/site-packages/Sybase.py", line 242, in
> _extract_row
>     row[col] = _column_value(buf[n])
> TypeError: unknown data format
> 
> ---
> 
> def _column_value(val):
>     if use_datetime and type(val) is DateTimeType:
>         return DateTime.DateTime(val.year, val.month + 1, val.day,
>                                  val.hour, val.minute,
>                                  val.second + val.msecond / 1000.0)
>     else:
>         return val
> 
> def _extract_row(bufs, n):
>     '''Extract a row tuple from buffers.
>     '''
>     row = [None] * len(bufs)
>     col = 0
>     for buf in bufs:
> --->>>> row[col] = _column_value(buf[n])  <-----  ERROR HERE
>         col = col + 1
>     return tuple(row)
> 
> _______________________________________________
> Python-sybase mailing list
> Python-sybase at www.object-craft.com.au
> https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase
-- 
Paul Rensing <paulrensing at verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: databuf.patch
Type: text/x-patch
Size: 355 bytes
Desc: not available
Url : http://www.object-craft.com.au/pipermail/python-sybase/attachments/20050908/bf8e98c1/databuf.bin


More information about the Python-sybase mailing list