You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
(3) |
Apr
(26) |
May
(7) |
Jun
|
Jul
(12) |
Aug
|
Sep
(13) |
Oct
(6) |
Nov
(14) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(31) |
Feb
(15) |
Mar
(6) |
Apr
(18) |
May
(11) |
Jun
(3) |
Jul
(7) |
Aug
(5) |
Sep
(6) |
Oct
(1) |
Nov
(2) |
Dec
(6) |
2004 |
Jan
(3) |
Feb
(3) |
Mar
(18) |
Apr
(4) |
May
(13) |
Jun
(32) |
Jul
(21) |
Aug
(22) |
Sep
(11) |
Oct
(2) |
Nov
(6) |
Dec
(5) |
2005 |
Jan
(4) |
Feb
(16) |
Mar
(21) |
Apr
(10) |
May
(1) |
Jun
(5) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(15) |
Nov
(20) |
Dec
|
2006 |
Jan
(3) |
Feb
(1) |
Mar
(3) |
Apr
(5) |
May
(4) |
Jun
(6) |
Jul
(23) |
Aug
(6) |
Sep
(5) |
Oct
(8) |
Nov
|
Dec
(12) |
2007 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(9) |
Jun
(1) |
Jul
(6) |
Aug
(5) |
Sep
(3) |
Oct
|
Nov
(5) |
Dec
(6) |
2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(3) |
May
|
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
(1) |
Dec
(4) |
2009 |
Jan
|
Feb
(2) |
Mar
(16) |
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(21) |
Sep
(11) |
Oct
(4) |
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2011 |
Jan
(9) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sébastien S. <sa...@us...> - 2008-06-18 08:40:55
|
Hi Skip, thanks for the bug report, I made the correction in trunk: $ svn commit Sybase.py ChangeLog -m "Corrected bug in type mapping in callproc" Envoi ChangeLog Envoi Sybase.py Transmission des données .. Révision 432 propagée. regards -- Sébastien Sablé sk...@po... a écrit : > I see this code in a couple places in Cursor.callproc (v 0.39): > > if self.inputmap is not None: > for tp in type(value).__mro__: > converter = cursor.inputmap.get(tp, None) > if converter is not None: > break > if converter is not None: > value = converter(value) > > "cursor.inputmap" should almost certainly be "self.inputmap". > > Skip > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Python-sybase-misc mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-sybase-misc |
From: <sk...@po...> - 2008-06-17 19:49:24
|
I see this code in a couple places in Cursor.callproc (v 0.39): if self.inputmap is not None: for tp in type(value).__mro__: converter = cursor.inputmap.get(tp, None) if converter is not None: break if converter is not None: value = converter(value) "cursor.inputmap" should almost certainly be "self.inputmap". Skip |
From: <sk...@po...> - 2008-06-17 15:48:27
|
(Sorry for the late followup. Just getting back to this.) Sébastien> In the mean time, here is an example that I use myself to Sébastien> shift the origin of Sybase dates and datetimes so that it Sébastien> corresponds to the ones used by Oracle: ... Sébastien> outputmap = dict(Sybase.DateTimeAsPython) ... Sébastien, Thanks for the example. I see that the Sybase module has a DateTimeAsPython dict but not a PythonAsDateTime dict for use as an inputmap. Is that not needed? Even if Sybase.PythonAsDateTime would be empty it would be useful for symmetry to have it, with perhaps a comment why. Thanks, -- Skip Montanaro - sk...@po... - http://www.webfast.com/~skip/ "Be different, express yourself like everyone else." |
From: Sébastien S. <sa...@us...> - 2008-04-15 16:41:04
|
Hi Skip, I should definitely write some documentation about this. In the mean time, here is an example that I use myself to shift the origin of Sybase dates and datetimes so that it corresponds to the ones used by Oracle: import Sybase from datetime import date, datetime MY_DATE_ORIGIN = date(1752, 9, 14) MY_DATETIME_ORIGIN = datetime(1752, 9, 14, 0, 0) SYBASE_DATE_ORIGIN = date(1753, 1, 1) SYBASE_DATETIME_ORIGIN = datetime(1753, 1, 1, 0, 0) outputmap = dict(Sybase.DateTimeAsPython) def change_outdatetime_origin(val): d = datetime(val.year, val.month + 1, val.day, val.hour, val.minute, val.second, val.msecond * 1000) if d.date() == SYBASE_DATE_ORIGIN: d = MY_DATETIME_ORIGIN return d def change_outdate_origin(val): d = date(val.year, val.month + 1, val.day) if d == SYBASE_DATE_ORIGIN: d = MY_DATE_ORIGIN return d outputmap.update({ Sybase.CS_DATETIME_TYPE: change_outdatetime_origin, Sybase.CS_DATETIME4_TYPE: change_outdatetime_origin, Sybase.CS_DATE_TYPE: change_outdate_origin }) def change_indate_origin(val): if val < SYBASE_DATE_ORIGIN: val = SYBASE_DATE_ORIGIN return val def change_indatetime_origin(val): if val < SYBASE_DATETIME_ORIGIN: val = SYBASE_DATETIME_ORIGIN return val inputmap = { datetime: change_indatetime_origin, date: change_indate_origin } conn = Sybase.connect(server, user, password, database, inputmap=inputmap, outputmap=outputmap) regards -- Sébastien Sablé sk...@po... a écrit : > In the python-sybase documentation it says 0.39 implements Carsten Haese's > type mapping extension to the DB-API. That specification is a bit ambiguous > when it comes to naming the keys in the input and output maps. It says: > > When a value is fetched from the database, if the value is not None, its > column type (as it would be indicated in cursor.description) is looked > up in outputmap, and the resulting callable object is called upon to > convert the fetched value... > > The DB-API uses integer type codes in the description tuple, not strings. > PEP 249 says: > > The type_code can be interpreted by comparing it to the Type Objects > specified in the section below. > > Later on it says: > > The type_code must compare equal to one of Type Objects defined below. > > What am I supposed to use as keys in my input and output maps? Python > strings (as Carsten's document suggests)? Ints (implied by how type_codes > are represeted in .description)? Type Objects? Is there a list somewhere > of valid key values? Any example usage? I'm specifically interested in > transparently representing dates and times using objects from Python's > datetime module. > > Thanks, > |
From: <sk...@po...> - 2008-04-14 17:42:08
|
In the python-sybase documentation it says 0.39 implements Carsten Haese's type mapping extension to the DB-API. That specification is a bit ambiguous when it comes to naming the keys in the input and output maps. It says: When a value is fetched from the database, if the value is not None, its column type (as it would be indicated in cursor.description) is looked up in outputmap, and the resulting callable object is called upon to convert the fetched value... The DB-API uses integer type codes in the description tuple, not strings. PEP 249 says: The type_code can be interpreted by comparing it to the Type Objects specified in the section below. Later on it says: The type_code must compare equal to one of Type Objects defined below. What am I supposed to use as keys in my input and output maps? Python strings (as Carsten's document suggests)? Ints (implied by how type_codes are represeted in .description)? Type Objects? Is there a list somewhere of valid key values? Any example usage? I'm specifically interested in transparently representing dates and times using objects from Python's datetime module. Thanks, -- Skip Montanaro - sk...@po... - http://www.webfast.com/~skip/ |
From: Sébastien S. <sa...@us...> - 2008-04-14 10:15:52
|
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.39.tar.gz The module home page is here: http://python-sybase.sourceforge.net/ MAJOR CHANGES SINCE 0.38: * Added type mapping as proposed in http://www.uniqsys.com/~carsten/typemap.html by Carsten Haese * Handle engineer notation of numbers in numeric * Added support for CS_DATE_TYPE * Added support for python Decimal objects in databuf * Possibility to use ct_cursor for some requests * Refactoring - merged Fetchers, CTCursor and CmdCursor in Cursor * Refactored _cancel_cmd * Added a prepare method to Cursor * Additional 'locale' argument to connect and Connection to set the locale of the connection thanks to patch by Harri Pasanen * Better compliance with DBAPI: returns None in nextset when no more set * Added conversion from string to int when assigning to a CS_INT_TYPE DataBuf BUGS CORRECTED SINCE 0.39pre1: * Corrected "undefined symbol" date_datafmt for Sybase versions where CS_DATE_TYPE is not defined (as reported by Alexey Morsov) BUGS CORRECTED SINCE 0.38: * Corrected documentation about CS_CONTEXT Objects thanks to bug report by Derek Harland (close tracker 1748109) * Corrected bug in close() if connection killed from outside thanks to patch by Derek Harland (close tracker 1746220) * Corrected bug if inherit from Sybase.Connection thanks to patch by Derek Harland (close tracker 1719789) * Optimization in fetchall - using fetchmany instead of fetchone to avoid locking time penalty, thanks to patch by Derek Harland (close tracker 1746908) * Corrections to compile with bcp-support against freetds thanks to patch by Klaus-Martin Hansche (close tracker 1724088) * Corrected documentation to compile with FreeTDS and Threads thanks to Derek Harland (close tracker 1709043) * Corrected bug in databuf_alloc: Sybase reports the wrong maxlength for numeric type - verified with Sybase 12.5 - thanks to patch provided by Phil Porter * Better detection of Sybase libraries * the C API to datetime only exists since python 2.4 - disable datetime with previous versions * Corrected python long handling (using CS_NUMERIC instead of CS_LONG which is unspecified) * Corrected various compilation warnings (some linked to python 2.5) The full ChangeLog is here: https://python-sybase.svn.sourceforge.net/svnroot/python-sybase/tags/r0_39/ChangeLog |
From: Sébastien S. <sa...@us...> - 2008-02-12 10:48:59
|
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. ** This version is a pre-release not intended for production use ** The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.39pre1.tar.gz The module home page is here: http://python-sybase.sourceforge.net/ MAJOR CHANGES SINCE 0.38: * Added type mapping as proposed in http://www.uniqsys.com/~carsten/typemap.html by Carsten Haese * Handle engineer notation of numbers in numeric * Added support for CS_DATE_TYPE * Added support for python Decimal objects in databuf * Possibility to use ct_cursor for some requests * Refactoring - merged Fetchers, CTCursor and CmdCursor in Cursor * Refactored _cancel_cmd * Added a prepare method to Cursor * Additional 'locale' argument to connect and Connection to set the locale of the connection thanks to patch by Harri Pasanen * Better compliance with DBAPI: returns None in nextset when no more set * Added conversion from string to int when assigning to a CS_INT_TYPE DataBuf BUGS CORRECTED SINCE 0.38: * Corrected documentation about CS_CONTEXT Objects thanks to bug report by Derek Harland (close tracker 1748109) * Corrected bug in close() if connection killed from outside thanks to patch by Derek Harland (close tracker 1746220) * Corrected bug if inherit from Sybase.Connection thanks to patch by Derek Harland (close tracker 1719789) * Optimization in fetchall - using fetchmany instead of fetchone to avoid locking time penalty, thanks to patch by Derek Harland (close tracker 1746908) * Corrections to compile with bcp-support against freetds thanks to patch by Klaus-Martin Hansche (close tracker 1724088) * Corrected documentation to compile with FreeTDS and Threads thanks to Derek Harland (close tracker 1709043) * Corrected bug in databuf_alloc: Sybase reports the wrong maxlength for numeric type - verified with Sybase 12.5 - thanks to patch provided by Phil Porter * Better detection of Sybase libraries * the C API to datetime only exists since python 2.4 - disable datetime with previous versions * Corrected python long handling (using CS_NUMERIC instead of CS_LONG which is unspecified) * Corrected various compilation warnings (some linked to python 2.5) The full ChangeLog is here: https://python-sybase.svn.sourceforge.net/svnroot/python-sybase/tags/r0_39pre1/ChangeLog |
From: <sa...@us...> - 2008-01-04 09:57:54
|
Hi Roy, the C api to use datetime objects seems to be new in Python 2.4. So python-sybase cannot be compiled with the -DHAVE_DATETIME option with Python 2.3. You can correct this problem by applying the patch that I join to the setup.py file. This patch will be included in python-sybase 0.39. regards -- Sébastien Sablé Roy Smith a écrit : > I've got the following components: > > python-sybase-0.38 > freetds-0.64 > Python 2.3.4 (#1, Feb 2 2005, 11:44:13) > Red Hat Enterprise Linux AS release 4 (Nahant Update 3) > > When I try to build the sybase module, I get > > ---------------------------------------- > kirin:python-sybase-0.38$ python setup.py build_ext -D HAVE_FREETDS -U > WANT_BULKCOPY > running build_ext > building 'sybasect' extension > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 > -D_GNU_SOURCE -fPIC -DHAVE_FREETDS -fPIC -DWANT_BULKCOPY -DSYB_LP64 > -DHAVE_DATETIME -DHAVE_FREETDS=1 -UWANT_BULKCOPY > -I/usr/local/freetds/include -I/usr/include/python2.3 -c sybasect.c -o > build/temp.linux-x86_64-2.3/sybasect.o > sybasect.c: In function `date_check': > sybasect.c:109: error: `PyDateTime_DateType' undeclared (first use in > this function) > sybasect.c:109: error: (Each undeclared identifier is reported only once > sybasect.c:109: error: for each function it appears in.) > sybasect.c: In function `initsybasect': > sybasect.c:1564: error: `PyDateTime_IMPORT' undeclared (first use in > this function) > error: command 'gcc' failed with exit status 1 > ---------------------------------------- > > Anybody have any clue what's going wrong? > > I've also got a deeper question (which probably exposes just how little > clue I have about this stuff). My end goal is to talk to a MS SQL > Server database running on a Windows box. My understanding is that the > combination of the python-sybase module and the FreeTDS driver will let > me do that. Is that correct? > > > > ------------------- > Roy Smith <smi...@em... <mailto:smi...@em...>> > Software Guy, EMC Common Management Group > 44 South Broadway, 7th floor > White Plains, NY 10601 > (914) 580-3427 > AIM: roysmith649 > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Python-sybase-misc mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-sybase-misc |
From: Roy S. <smi...@em...> - 2007-12-22 15:49:11
|
I've got the following components: python-sybase-0.38 freetds-0.64 Python 2.3.4 (#1, Feb 2 2005, 11:44:13) Red Hat Enterprise Linux AS release 4 (Nahant Update 3) When I try to build the sybase module, I get ---------------------------------------- kirin:python-sybase-0.38$ python setup.py build_ext -D HAVE_FREETDS - U WANT_BULKCOPY running build_ext building 'sybasect' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 - D_GNU_SOURCE -fPIC -DHAVE_FREETDS -fPIC -DWANT_BULKCOPY -DSYB_LP64 - DHAVE_DATETIME -DHAVE_FREETDS=1 -UWANT_BULKCOPY -I/usr/local/freetds/ include -I/usr/include/python2.3 -c sybasect.c -o build/temp.linux- x86_64-2.3/sybasect.o sybasect.c: In function `date_check': sybasect.c:109: error: `PyDateTime_DateType' undeclared (first use in this function) sybasect.c:109: error: (Each undeclared identifier is reported only once sybasect.c:109: error: for each function it appears in.) sybasect.c: In function `initsybasect': sybasect.c:1564: error: `PyDateTime_IMPORT' undeclared (first use in this function) error: command 'gcc' failed with exit status 1 ---------------------------------------- Anybody have any clue what's going wrong? I've also got a deeper question (which probably exposes just how little clue I have about this stuff). My end goal is to talk to a MS SQL Server database running on a Windows box. My understanding is that the combination of the python-sybase module and the FreeTDS driver will let me do that. Is that correct? ------------------- Roy Smith <smi...@em...> Software Guy, EMC Common Management Group 44 South Broadway, 7th floor White Plains, NY 10601 (914) 580-3427 AIM: roysmith649 |
From: <sa...@us...> - 2007-12-10 18:31:55
|
Hi Oliver, 4040 is the code for CS_ROW_RESULT. I am not sure why it happens at that time. The coming version of python-sybase in svn should be able to handle this more gracefully but it is not completely ready yet. I hope to be able to release it before the end of the month or early next year. If the problem persists when this new version is released, then please send me an email so that we can write a small test case. regards -- Sébastien Sablé Bock, Oliver BGI SYD a écrit : > I am connecting to Sybase IQ/12.6.0 using python-sybase and Adaptive > Server IQ Network Client 12.6 on Windows XP. Everything works fine for > small queries, but a very large query (73000 rows returned) fails like > this: > > Traceback (most recent call last): > File "C:\workspace\AlphaExplorer\sql.py", line 19, in ? > row = curs.fetchone() > File "C:\Python24\Lib\site-packages\Sybase.py", line 817, in fetchone > return self._fetcher.fetchone() > File "C:\Python24\Lib\site-packages\Sybase.py", line 555, in fetchone > self._fetch_rowcount() > File "C:\Python24\Lib\site-packages\Sybase.py", line 682, in > _fetch_rowcount > self._raise_error(Error, 'ct_results returned result %s' % > str(result)) > File "C:\Python24\Lib\site-packages\Sybase.py", line 519, in > _raise_error > raise exc(text) > Sybase.Error: ct_results returned result 4040 > > This error occurs after I have fetched the last row. (That is, I expect > it to return None, indicating that there is nothing left.) > > Note that I have modified _fetch_rowcount to give information on the > result code returned, and it is 4040, which may correspond to > CS_ROW_RESULT, although I cannot work out why this should be returned at > this time. > > I can work around the problem by catching the "ct_results" exception and > ignoring it, but obviously I would prefer to get to the root cause of > the problem. > > > Oliver > > > P.S. python-sybase is MUCH faster than ODBC for this large query: ODBC > takes 25 minutes and python-sybase takes 18 seconds! (The server is in > another country so I guess there is a very high network latency.) > |
From: Joseph B. <jos...@gm...> - 2007-12-06 17:12:50
|
Too good, thanks for your links !! So, as you proposed, I tried with the MS Compiler and libraries listed (and the python.org), getting further to another problem... For the next one, when you get: > 'cspublic.h': No such file or directory it's not MS or python libraries but Sybase's OCS /include files that are needed (subDir of sybase home ; Env Var: SYBASE_OCS). Now it's compiled ! Thanks On Dec 6, 2007 5:19 AM, Bock, Oliver BGI SYD <Oli...@ba...> wrote: > > From: Jeffrey Zelt <Jeffrey.Zelt@q-...> - 2007-09-03 13:04 > > I am having trouble installing the python-sybase module on Windows XP > > and I wonder if anyone can help me... > > I managed to build python-sybase for ActiveState Python 2.4 (should also > work for normal python.org distribution). I followed the instructions > at: > > http://www.vrplumber.com/programming/mstoolkit/ > > and found a copy of the old Microsoft Visual C++ Toolkit 2003 compiler > at > > http://npg.dl.ac.uk/MIDAS/download/midassort/midassort_Windows.html > > I had to edit the environment variables because the latest Windows > Platform SDK installs to a different directory. > > I would be happy to e-mail the distribution to anyone who asks for it in > the next few weeks, or I could upload it if someone gives me the right > permissions. Of course it will only work for Python 2.4. > > > Oliver > > -- > > This message and any attachments are confidential, proprietary, and may be > privileged. If this message was misdirected, Barclays Global Investors > (BGI) does not waive any confidentiality or privilege. If you are not the > intended recipient, please notify us immediately and destroy the message > without disclosing its contents to anyone. Any distribution, use or copying > of this e-mail or the information it contains by other than an intended > recipient is unauthorized. The views and opinions expressed in this e-mail > message are the author's own and may not reflect the views and opinions of > BGI, unless the author is authorized by BGI to express such views or > opinions on its behalf. All email sent to or from this address is subject > to electronic storage and review by BGI. Although BGI operates anti-virus > programs, it does not accept responsibility for any damage whatsoever caused > by viruses being passed. > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Python-sybase-misc mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-sybase-misc > |
From: Bock, O. B. S. <Oli...@ba...> - 2007-12-06 04:41:22
|
I am connecting to Sybase IQ/12.6.0 using python-sybase and Adaptive Server IQ Network Client 12.6 on Windows XP. Everything works fine for small queries, but a very large query (73000 rows returned) fails like this: Traceback (most recent call last): File "C:\workspace\AlphaExplorer\sql.py", line 19, in ? row =3D curs.fetchone() File "C:\Python24\Lib\site-packages\Sybase.py", line 817, in fetchone return self._fetcher.fetchone() File "C:\Python24\Lib\site-packages\Sybase.py", line 555, in fetchone self._fetch_rowcount() File "C:\Python24\Lib\site-packages\Sybase.py", line 682, in _fetch_rowcount self._raise_error(Error, 'ct_results returned result %s' % str(result)) File "C:\Python24\Lib\site-packages\Sybase.py", line 519, in _raise_error raise exc(text) Sybase.Error: ct_results returned result 4040 This error occurs after I have fetched the last row. (That is, I expect it to return None, indicating that there is nothing left.) Note that I have modified _fetch_rowcount to give information on the result code returned, and it is 4040, which may correspond to CS_ROW_RESULT, although I cannot work out why this should be returned at this time. I can work around the problem by catching the "ct_results" exception and ignoring it, but obviously I would prefer to get to the root cause of the problem. Oliver P.S. python-sybase is MUCH faster than ODBC for this large query: ODBC takes 25 minutes and python-sybase takes 18 seconds! (The server is in another country so I guess there is a very high network latency.)=20 =20 --=20 =20 This message and any attachments are confidential, proprietary, and may = be privileged. If this message was misdirected, Barclays Global = Investors (BGI) does not waive any confidentiality or privilege. If you = are not the intended recipient, please notify us immediately and destroy = the message without disclosing its contents to anyone. Any = distribution, use or copying of this e-mail or the information it = contains by other than an intended recipient is unauthorized. The views = and opinions expressed in this e-mail message are the author's own and = may not reflect the views and opinions of BGI, unless the author is = authorized by BGI to express such views or opinions on its behalf. All = email sent to or from this address is subject to electronic storage and = review by BGI. Although BGI operates anti-virus programs, it does not = accept responsibility for any damage whatsoever caused by viruses being = passed. |
From: Bock, O. B. S. <Oli...@ba...> - 2007-12-06 04:20:28
|
> From: Jeffrey Zelt <Jeffrey.Zelt@q-...> - 2007-09-03 13:04 > I am having trouble installing the python-sybase module on Windows XP > and I wonder if anyone can help me... I managed to build python-sybase for ActiveState Python 2.4 (should also work for normal python.org distribution). I followed the instructions at: http://www.vrplumber.com/programming/mstoolkit/ and found a copy of the old Microsoft Visual C++ Toolkit 2003 compiler at=20 http://npg.dl.ac.uk/MIDAS/download/midassort/midassort_Windows.html I had to edit the environment variables because the latest Windows Platform SDK installs to a different directory. I would be happy to e-mail the distribution to anyone who asks for it in the next few weeks, or I could upload it if someone gives me the right permissions. Of course it will only work for Python 2.4. Oliver=20 =20 --=20 =20 This message and any attachments are confidential, proprietary, and may = be privileged. If this message was misdirected, Barclays Global = Investors (BGI) does not waive any confidentiality or privilege. If you = are not the intended recipient, please notify us immediately and destroy = the message without disclosing its contents to anyone. Any = distribution, use or copying of this e-mail or the information it = contains by other than an intended recipient is unauthorized. The views = and opinions expressed in this e-mail message are the author's own and = may not reflect the views and opinions of BGI, unless the author is = authorized by BGI to express such views or opinions on its behalf. All = email sent to or from this address is subject to electronic storage and = review by BGI. Although BGI operates anti-virus programs, it does not = accept responsibility for any damage whatsoever caused by viruses being = passed. |
From: Joseph B. <jos...@gm...> - 2007-12-05 09:41:39
|
Hi, I'm far from knowing C compiling... but it looks like I need some files... python setup.py install > > running install > running build > running build_py > running build_ext > building 'sybasect' extension > C:\Borland\BCC55\Bin\bcc32.exe -c /tWM /O2 /q /g0 -DWANT_BULKCOPY > -DHAVE_DATETIM > E -Id:\appliloc\sybase\OCS-12_0\include -IC:\Python24\include > -IC:\Python24\PC > -obuild\temp.win32-2.4\Release\blk.obj blk.c > blk.c: > Error E2209 C:\Python24\include\pyconfig.h 30: Unable to open include file > 'io.h > ' > Error E2209 C:\Python24\include\pyconfig.h 152: Unable to open include > file 'io. > h' > Error E2209 C:\Python24\include\pyconfig.h 196: Unable to open include > file 'std > io.h' > Error E2209 C:\Python24\include\Python.h 18: Unable to open include file > 'limits > .h' > Fatal F1003 C:\Python24\include\Python.h 21: Error directive: "Something's > broke > n. UCHAR_MAX should be defined in limits.h." > *** 5 errors in Compile *** > error: command 'bcc32.exe' failed with exit status 1 As said on http://python-sybase.sourceforge.net//sybase/node4.html, the Sybase client libraries should have come as part of my Sybase installation... but I apparently need more ! please help however, a concurrent question: why a such module does not have already compiled files available on the web ? at least for main systems. Joseph |
From: <sa...@us...> - 2007-11-09 18:02:12
|
Hi Phil, You can post your patch here. Concerning your problem, I think it is a known bug when calling a stored procedure with execute. Could you try con.callproc("qGetDomain @Domain='linux2000.com'") instead of con.execute? If it works, then the problem is probably corrected in trunk. I have an alpha version of python-sybase 0.39 on its way with many changes, but I still need to finish a few things before to release it. regards -- Sébastien Sablé Phil Edwards a écrit : > Hi All: > > I've built and installed python-sybase v0.38 on a freshly installed > CentOs5 machine and I have a couple of issues I;d appreciate some > feedback on: > > 1. Due to CentOS installing the FreeTDS header files in a slightly odd > location, I had to modify the setup.py script in order for the build_ext > process to work. It would probably be helpful to submit the changes to > the developers, so should I post my modifications here or direct to the > dev team? > > 2. I have a very simple-minded test script which reads a single row of > data out of our customer database: > > db = Sybase.connect(DBNAME, DBUSER, DBPASS) > con = db.cursor() > con.execute("qGetDomain @Domain='linux2000.com'") > result = con.fetchall() > for line in result: print str(line) > > This code throws an exception on the call to fetchall(). The error text > doesn't seem to give any useful information: > > File "./crmtest.py", line 27, in ? > result = con.fetchall() > File "/usr/lib/python2.4/site-packages/Sybase.py", line 831, in fetchall > return self._fetcher.fetchall() > File "/usr/lib/python2.4/site-packages/Sybase.py", line 605, in fetchall > row = self.fetchone() > File "/usr/lib/python2.4/site-packages/Sybase.py", line 555, in fetchone > self._fetch_rowcount() > File "/usr/lib/python2.4/site-packages/Sybase.py", line 682, in > _fetch_rowcount > self._raise_error(Error, 'ct_results') > File "/usr/lib/python2.4/site-packages/Sybase.py", line 519, in > _raise_error > raise exc(text) > Sybase.Error: ct_results > > Oddly, a call to fetchone() works as expected. Is there any reason why > calling fetchall() with only a single row in the result set should fail > like this? > |
From: Phil E. <ph...@li...> - 2007-11-09 17:32:42
|
Sébastien Sablé wrote: > Hi Phil, > > You can post your patch here. > Probably not the prettiest code, but it seems to work. The issue being worked around is that on CentOS5 the FreeTDS header files get installed in /usr/include/freetds rather than /usr/include. -----begin diff output----- --- setup.py.org 2007-11-08 16:59:42.000000000 +0000 +++ setup.py 2007-11-08 17:23:23.000000000 +0000 @@ -85,9 +85,16 @@ 'mail to dj...@ob... so you can help other people.\n') sys.exit(1) -syb_incdir = os.path.join(sybase, 'include') +# fixes to make compilation work on CentOS5 +_incdirs = [] +_incdirs.append(os.path.join(sybase, 'include')) +_incdirs.append(os.path.join(_incdirs[0], 'freetds')) + +syb_incdir = _incdirs syb_libdir = os.path.join(sybase, 'lib') -for dir in (syb_incdir, syb_libdir): +_dirs = syb_incdir +_dirs.append(syb_libdir) +for dir in _dirs: if not os.access(dir, os.F_OK): sys.stderr.write('Directory %s does not exist - cannot build.\n' % dir) sys.exit(1) @@ -146,15 +153,20 @@ for api in ('blk_alloc', 'blk_describe', 'blk_drop', 'blk_rowxfer_mult', 'blk_textxfer',): - if api_exists(api, os.path.join(syb_incdir, 'bkpublic.h')): - syb_macros.append(('HAVE_' + string.upper(api), None)) + for dir in syb_incdir: + if api_exists(api, os.path.join(dir, 'bkpublic.h')): + syb_macros.append(('HAVE_' + string.upper(api), None)) + for api in ('ct_cursor', 'ct_data_info', 'ct_dynamic', 'ct_send_data', 'ct_setparam',): - if api_exists(api, os.path.join(syb_incdir, 'ctpublic.h')): - syb_macros.append(('HAVE_' + string.upper(api), None)) + for dir in syb_incdir: + if api_exists(api, os.path.join(dir, 'ctpublic.h')): + syb_macros.append(('HAVE_' + string.upper(api), None)) + for api in ('cs_calc', 'cs_cmp',): - if api_exists(api, os.path.join(syb_incdir, 'cspublic.h')): - syb_macros.append(('HAVE_' + string.upper(api), None)) + for dir in syb_incdir: + if api_exists(api, os.path.join(dir, 'cspublic.h')): + syb_macros.append(('HAVE_' + string.upper(api), None)) class PreReleaseCheck: def __init__(self, distribution): @@ -207,7 +219,7 @@ description="Sybase Extension to Python", url="http://python-sybase.sourceforge.net/", py_modules=['Sybase'], - include_dirs=[syb_incdir], + include_dirs=syb_incdir, ext_modules=[ Extension('sybasect', ['blk.c', 'databuf.c', 'cmd.c', 'conn.c', 'ctx.c', ------end diff output------ > Concerning your problem, I think it is a known bug when calling a stored > procedure with execute. > Could you try con.callproc("qGetDomain @Domain='linux2000.com'") instead > of con.execute? > Cool, I'll give that a try and see how I get on. Thanks. -- Regards Phil Edwards Brighton, UK |
From: Phil E. <ph...@li...> - 2007-11-09 14:06:32
|
Phil Edwards wrote: > Phil Edwards wrote: >> I've built and installed python-sybase v0.38 on a freshly installed >> CentOs5 machine and I have a couple of issues I;d appreciate some >> feedback on: >> I've now found that v0.37 works on my CentOS server, so the problem is definitely being caused by something in v0.38 > > I forgot to mention that the FreeTDS version which is installed is 0.64, > this from the standard CentOS5 RPMs: > > # rpm -qa|grep -i tds > freetds-0.64-1.el5.rf > freetds-devel-0.64-1.el5.rf > -- Regards Phil Edwards Brighton, UK |
From: Phil E. <ph...@li...> - 2007-11-09 12:46:36
|
Phil Edwards wrote: > > I've built and installed python-sybase v0.38 on a freshly installed > CentOs5 machine and I have a couple of issues I;d appreciate some > feedback on: > I forgot to mention that the FreeTDS version which is installed is 0.64, this from the standard CentOS5 RPMs: # rpm -qa|grep -i tds freetds-0.64-1.el5.rf freetds-devel-0.64-1.el5.rf -- Regards Phil Edwards Brighton, UK |
From: Phil E. <ph...@li...> - 2007-11-09 10:09:37
|
Hi All: I've built and installed python-sybase v0.38 on a freshly installed CentOs5 machine and I have a couple of issues I;d appreciate some feedback on: 1. Due to CentOS installing the FreeTDS header files in a slightly odd location, I had to modify the setup.py script in order for the build_ext process to work. It would probably be helpful to submit the changes to the developers, so should I post my modifications here or direct to the dev team? 2. I have a very simple-minded test script which reads a single row of data out of our customer database: db = Sybase.connect(DBNAME, DBUSER, DBPASS) con = db.cursor() con.execute("qGetDomain @Domain='linux2000.com'") result = con.fetchall() for line in result: print str(line) This code throws an exception on the call to fetchall(). The error text doesn't seem to give any useful information: File "./crmtest.py", line 27, in ? result = con.fetchall() File "/usr/lib/python2.4/site-packages/Sybase.py", line 831, in fetchall return self._fetcher.fetchall() File "/usr/lib/python2.4/site-packages/Sybase.py", line 605, in fetchall row = self.fetchone() File "/usr/lib/python2.4/site-packages/Sybase.py", line 555, in fetchone self._fetch_rowcount() File "/usr/lib/python2.4/site-packages/Sybase.py", line 682, in _fetch_rowcount self._raise_error(Error, 'ct_results') File "/usr/lib/python2.4/site-packages/Sybase.py", line 519, in _raise_error raise exc(text) Sybase.Error: ct_results Oddly, a call to fetchone() works as expected. Is there any reason why calling fetchall() with only a single row in the result set should fail like this? -- Regards Phil Edwards Brighton, UK |
From: Michel A. <Mic...@st...> - 2007-09-19 07:23:39
|
> I am having trouble installing the python-sybase module on Windows XP > and I wonder if anyone can help me. > > It seems that a C compiler is necessary for installing this module. > According to:=20 > > http://python-sybase.sourceforge.net/install.html : > > "The Micorsoft Visual C++ 2005 Express Edition compiler can be freely > downloaded and used. It can compile the Sybase module for Python." > > I have done as instructed and downloaded "Visual C++ 2005 Express > Edition". However, when I execute: > > python setup.py install > > I receive the following error: > > running install > running build > running build_py > running build_ext > error: Python was built with Visual Studio 2003; > extensions must be built with a compiler than can generate compatible > binaries. > Visual Studio 2003 was not found on this system. If you have Cygwin > installed, > you can try compiling with MingW32, by passing "-c mingw32" to > setup.py.=20 > > > It seems that Python25 on my machine was compiled with Visual Studio > 2003 and this is somehow incompatible with Visual ++ 2005 Express > Edition. =20 > > > What can I do? =20 > > > There seems to be only one Python installer at the python.org web site. > It seems that this version of Python was compiled with Visual Studio > 2003. I cannot find any reference that describes how to compile the > Python source on Windows. I am not a Windows expert. > > I do not have access to any other C compiler for Windows. Is there a > *pre-compiled* version of the python-sybase module for Windows XP? > > Any help/suggestions would be greatly appreciated.=20 > > Jeffrey Zelt I am having the same problem. I also tried to compile with Cygwin, but that failed as well. Any pointers? |
From: Jeffrey Z. <Jef...@q-...> - 2007-09-03 13:04:40
|
I am having trouble installing the python-sybase module on Windows XP and I wonder if anyone can help me. It seems that a C compiler is necessary for installing this module. According to:=20 http://python-sybase.sourceforge.net/install.html : "The Micorsoft Visual C++ 2005 Express Edition compiler can be freely downloaded and used. It can compile the Sybase module for Python." I have done as instructed and downloaded "Visual C++ 2005 Express Edition". However, when I execute: python setup.py install I receive the following error: running install running build running build_py running build_ext error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py.=20 It seems that Python25 on my machine was compiled with Visual Studio 2003 and this is somehow incompatible with Visual ++ 2005 Express Edition. =20 What can I do? =20 There seems to be only one Python installer at the python.org web site. It seems that this version of Python was compiled with Visual Studio 2003. I cannot find any reference that describes how to compile the Python source on Windows. I am not a Windows expert. I do not have access to any other C compiler for Windows. Is there a *pre-compiled* version of the python-sybase module for Windows XP? Any help/suggestions would be greatly appreciated.=20 Jeffrey Zelt |
From: <kre...@gm...> - 2007-09-03 12:38:21
|
Modified from the FreeTDS user guide: Download & unpack latest python-sybase, enter its directory. apt-get install gcc python2.5-dev freetds-dev export SYBASE=/usr export LD_LIBRARY_PATH=/usr:${LD_LIBRARY_PATH} export CFLAGS="-DHAVE_FREETDS" python setup.py install You don't need the dev packages any more, so you can remove them: apt-get remove --purge gcc python2.5-dev freetds-dev |
From: Bruno R. <br...@es...> - 2007-08-29 13:55:20
|
Hello all, I'm having a problem inserting TEXT data: it ends up truncated at 16384 bytes. At first I though @@textsize might be the reason, since it is set at 32k (double of my maximum size), but changing it does no good. The server isn't at fault either, I can do the insert using Java, it works fine. So here is my pledge: Has anyone else stumbled upon such a problem? Is there a solution? Thank you, Bruno |
From: Warren, J. <wa...@kb...> - 2007-08-17 16:57:14
|
Hi,=20 I don't suppose anyone would have a way to bulkcopy in NULL values? For example (__version__ =3D '0.38') :- from Sybase import * c =3D connect ('TEST_DS', 'sa', 'password', bulkcopy=3D1, auto_commit=3D1) c.execute("CREATE TABLE #t1 (a int, b INT NULL)") b=3Dc.bulkcopy('#t1') for r in range(32): b.rowxfer([r,None]) # None represents NULL when selected or bulkcopied out if r %5 =3D=3D 4: ret =3D b.batch() ret =3D b.done() This results in :- Sybase.Error: blk_rowxfer_mult in Many thanks, James. --=20 This message may contain confidential, proprietary, or legally privileged i= nformation. No confidentiality or privilege is waived by any transmission t= o an unintended recipient. If you are not an intended recipient, please not= ify the sender and delete this message immediately. Any views expressed in = this message are those of the sender, not those of any entity within the KB= C Financial Products group of companies (together referred to as "KBC FP").= =20 This message does not create any obligation, contractual or otherwise, on t= he part of KBC FP. It is not an offer (or solicitation of an offer) of, or = a recommendation to buy or sell, any financial product. Any prices or other= values included in this message are indicative only, and do not necessaril= y represent current market prices, prices at which KBC FP would enter into = a transaction, or prices at which similar transactions may be carried on KB= C FP's own books. The information contained in this message is provided "as= is", without representations or warranties, express or implied, of any kin= d. Past performance is not indicative of future returns. |
From: <sa...@us...> - 2007-08-14 05:31:15
|
Hi Harry, thank you for your patch to change the locale of the connection. It has been commited in revision 376 of the trunk and will be part of the next release. regards -- Sébastien Sablé $ svn commit -m "Additional 'locale' argument to connect and Connection to set the locale of the connection thanks to patch by Harri Pasanen" Envoi ChangeLog Envoi Sybase.py Envoi doc/dbapi.tex Transmission des données ... Révision 376 propagée. Harri Pasanen a écrit : > The attached patched allows setting the locale of the connection to > match that of the server. Otherwise you are likely to get the 2403 > warning/error from the Sybase if character sets mismatch in data. > > It is implemented as a new keyword argument to Sybase.connect(). > Example usage: > > cnx = Sybase.connect(dbServer, dbUser, dbPasswd, > auto_commit=1, datetime = 'python', > locale = 'utf8') > > > Enjoy, > > Harri |