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: Andrew M. <an...@ob...> - 2005-02-14 23:42:33
|
>Nonetheless, I tried your suggestion as follows: [...] >ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: >undefined symbol: cs_dt_info What does the output of: $ ldd /usr/local/lib/python2.4/site-packages/sybasect.so look like? I know very little about Sybase (I don't have it installed, either), but I've been working with the dynamic linkers under Linux (and Solaris) for years. I've seen this specific problem mentioned on the list a few times, but I can't find a solution in the list archives. The error is more suggestive of an incorrect library version, rather than a missing file, so pay careful attention to the paths. You can also use ldd to explore the shared dependancies of any other libraries being used by sybasect.so. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Andrew T. <and...@ap...> - 2005-02-14 22:02:31
|
On Fri, 2005-02-11 at 14:08 +1100, Andrew McNamara wrote: > >/temp.linux-i686-2.4/datetime.o build/temp.linux-i686-2.4/sybasect.o > >-L/opt/sybase/OCS-12_5/lib -o build/lib.linux-i686-2.4/sybasect.so > >running install_lib > >copying build/lib.linux-i686-2.4/Sybase.py > >-> /usr/local/lib/python2.4/site-packages > >copying build/lib.linux-i686-2.4/sybasect.so > >-> /usr/local/lib/python2.4/site-packages > >byte-compiling /usr/local/lib/python2.4/site-packages/Sybase.py to > >Sybase.pyc > >[root@scratch sybase-0.36]# > > > >[root@scratch sybase-0.36]# /usr/local/bin/python -ic "import Sybase" > >Traceback (most recent call last): > > File "<string>", line 1, in ? > > File "Sybase.py", line 20, in ? > > from sybasect import * > >ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: > >undefined symbol: cs_dt_info > > Try starting python like this and see if it makes any difference: > > $ LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib python -ic "import Sybase" > > Thanks for the suggestion Andrew. I believe my Sybase environment was already setup ok with the following variables set. [ajt@scratch ajt]$ env | grep -i ld LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib:/opt/sybase/OCS-12_5/lib3p:/opt/sybase/SQLRemote/lib:/opt/sybase/ASE-12_5/lib:/opt/tibco/tibrv/lib Nonetheless, I tried your suggestion as follows: [ajt@scratch ajt]$ LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib python -ic "import Sybase" Traceback (most recent call last): File "<string>", line 1, in ? File "/usr/local/lib/python2.4/site-packages/Sybase.py", line 20, in ? from sybasect import * ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: undefined symbol: cs_dt_info >>> Any further pointers appreciated. Thanks, ajt. -- Andrew Thomson <and...@ap...> |
From: John F. <jfa...@yo...> - 2005-02-13 01:23:05
|
Hi, I'd like to get python taking (connecting) to sybase from SUSE 9.2. Is there a set of instructions somewhere on the web? John |
From: Andrew M. <an...@ob...> - 2005-02-11 22:08:29
|
>/temp.linux-i686-2.4/datetime.o build/temp.linux-i686-2.4/sybasect.o >-L/opt/sybase/OCS-12_5/lib -o build/lib.linux-i686-2.4/sybasect.so >running install_lib >copying build/lib.linux-i686-2.4/Sybase.py >-> /usr/local/lib/python2.4/site-packages >copying build/lib.linux-i686-2.4/sybasect.so >-> /usr/local/lib/python2.4/site-packages >byte-compiling /usr/local/lib/python2.4/site-packages/Sybase.py to >Sybase.pyc >[root@scratch sybase-0.36]# > >[root@scratch sybase-0.36]# /usr/local/bin/python -ic "import Sybase" >Traceback (most recent call last): > File "<string>", line 1, in ? > File "Sybase.py", line 20, in ? > from sybasect import * >ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: >undefined symbol: cs_dt_info Try starting python like this and see if it makes any difference: $ LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib python -ic "import Sybase" -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Andrew T. <and...@ap...> - 2005-02-11 20:30:53
|
Hi, I'm now trying to use the sybase module under Linux RHEL 3 and Sybase 12.5. The module compiles and installs cleanly however scripts don't like importing Sybase. /temp.linux-i686-2.4/datetime.o build/temp.linux-i686-2.4/sybasect.o -L/opt/sybase/OCS-12_5/lib -o build/lib.linux-i686-2.4/sybasect.so running install_lib copying build/lib.linux-i686-2.4/Sybase.py -> /usr/local/lib/python2.4/site-packages copying build/lib.linux-i686-2.4/sybasect.so -> /usr/local/lib/python2.4/site-packages byte-compiling /usr/local/lib/python2.4/site-packages/Sybase.py to Sybase.pyc [root@scratch sybase-0.36]# [root@scratch sybase-0.36]# /usr/local/bin/python -ic "import Sybase" Traceback (most recent call last): File "<string>", line 1, in ? File "Sybase.py", line 20, in ? from sybasect import * ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: undefined symbol: cs_dt_info I have tried this with Python 2.2 as per installed by RHEL 3 and also with Python 2.4. Any guidance appreciated. Regards, Andrew. -- Andrew Thomson <and...@ap...> |
From: Christophe D. <Chr...@re...> - 2005-02-02 08:03:25
|
KioqIFN5YmFzZS5weQlUdWUgRmViICAxIDEzOjUyOjAwIDIwMDUKLS0tIFN5YmFzZS5weX4JTW9u IERlYyAxMyAxODoyMTo1OCAyMDA0CioqKioqKioqKioqKioqKgoqKiogNSwxMSAqKioqCiAgIwog IHRyeToKICAgICAgaW1wb3J0IGRhdGV0aW1lCi0gICAgIERhdGVUaW1lID0gZGF0ZXRpbWUKICAg ICAgdXNlX2RhdGV0aW1lID0gMQogIGV4Y2VwdCBJbXBvcnRFcnJvcjoKICAgICAgdHJ5OgotLS0g NSwxMCAtLS0tCg== |
From: Andrew T. <and...@ap...> - 2005-01-17 18:26:57
|
Sorry to be Pete repeat here... but should the python-sybase module be able to handle 2,000,000 stored procs...? I'm kind of at a loose end here. Regards, ajt. -------- Forwarded Message -------- From: Andrew Thomson <and...@ap...> To: pyt...@ww... Subject: [python-sybase] memory usage Date: Mon, 20 Dec 2004 12:22:11 +1100 I did notice another post about high memory usage. I too am experiencing the same thing. However eventually my machines runs out of physical and swap memory and then the script is terminated! :( Basically I have a script that is parsing around 2,000,000 rows of data. For every row, a field is extracted and then passed to a stored procedure to get some information back. Watching the process in top, I can see the memory increasing steadily. If I take out the Sybase stored procedure stuff and just hard code a value of the stored procedure output, the script runs to completion never using more than 4mb of memory. However with the Sybase query in, memory just steadily increases. PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 89567 ajt 112 0 21604K 19320K RUN 1:42 28.81% 28.81% python I'm running my script on Freebsd 5.3 using the port: py24-sybase-0.36_1 My script does the following: # connect to db db = Sybase.connect('dbhost', 'user', 'pass', 'db') # start for loop for text in fileinput.input("datafile"): # get cursor mnpcursor = db.cursor() # run stored proc mnpcursor.callproc('MnpMsisdn', [msisdn]) # get output row = mnpcursor.fetchone () # do stuff with row # close cursor mnpcursor.close () Is there are better way to be doing this or something I'm missing? Kind regards, ajt. -- Andrew Thomson <and...@ap...> |
From: Dave C. <dj...@ob...> - 2005-01-11 18:10:22
|
Skip Montanaro wrote: > Perhaps I spoke a bit too soon... > > Dave> There are two possible ways to attempt a fix. > > Dave> 1) Construct the Fetcher in the FETCHING state. This will mean > Dave> that any exception raised in the ct_command() or the ct_send() > Dave> function will result in ct_cancel(CS_CANCEL_ALL) when the > Dave> Fetcher is deleted. > > Dave> In _FetchLazy.__init__() change: > Dave> self._state = _LAZY_IDLE > Dave> to > Dave> self._state = _LAZY_FETCHING > > Skip> This didn't work. > > Dave> 2) Set the Fetcher state to FETCHING immediately before calling > Dave> ct_send() in _FetchLazy.start(). > > Dave> In _FetchLazy.start() change: > Dave> status = self._cmd.ct_send() > Dave> to > Dave> self._set_state(_LAZY_FETCHING) > Dave> status = self._cmd.ct_send() > > Skip> This did... > > Solution #2 worked on Solaris/Intel, but not on Linux (neither did solution > #1). Cursors created after an error still give a ct_send() error with this > message when their execute() method is called: > > ct_send(): user api layer: external error: This routine cannot be called > because another command structure has results pending. Hmmm... Looks like I have to do some more research into the CT library state machine. - Dave -- http://www.object-craft.com.au |
From: Skip M. <sk...@po...> - 2005-01-07 19:23:46
|
Perhaps I spoke a bit too soon... Dave> There are two possible ways to attempt a fix. Dave> 1) Construct the Fetcher in the FETCHING state. This will mean Dave> that any exception raised in the ct_command() or the ct_send() Dave> function will result in ct_cancel(CS_CANCEL_ALL) when the Dave> Fetcher is deleted. Dave> In _FetchLazy.__init__() change: Dave> self._state = _LAZY_IDLE Dave> to Dave> self._state = _LAZY_FETCHING Skip> This didn't work. Dave> 2) Set the Fetcher state to FETCHING immediately before calling Dave> ct_send() in _FetchLazy.start(). Dave> In _FetchLazy.start() change: Dave> status = self._cmd.ct_send() Dave> to Dave> self._set_state(_LAZY_FETCHING) Dave> status = self._cmd.ct_send() Skip> This did... Solution #2 worked on Solaris/Intel, but not on Linux (neither did solution #1). Cursors created after an error still give a ct_send() error with this message when their execute() method is called: ct_send(): user api layer: external error: This routine cannot be called because another command structure has results pending. Skip |
From: Skip M. <sk...@po...> - 2005-01-07 19:23:46
|
Sorry to take so long to get back to this problem. Squeaky wheels and all, you know... >> If a cursor's execute() method results in an error (say, from a >> trigger failing for some reason) it appears there is no recourse to >> continue other than closing the connection and starting over. Here's >> the simple test case: >> >> c = Sybase.Connection(...) >> c1 = c.cursor() >> c1.execute("select * from blah") >> c2 = c.cursor() >> c2.execute("select 1") ... Dave> I think I know what is causing this. If someone could do an Dave> experiment for me I will make the change and cut a new release Dave> (with the output hook patch as well). ... Dave> There are two possible ways to attempt a fix. Dave> 1) Construct the Fetcher in the FETCHING state. This will mean Dave> that any exception raised in the ct_command() or the ct_send() Dave> function will result in ct_cancel(CS_CANCEL_ALL) when the Dave> Fetcher is deleted. Dave> In _FetchLazy.__init__() change: Dave> self._state = _LAZY_IDLE Dave> to Dave> self._state = _LAZY_FETCHING This didn't work. Dave> 2) Set the Fetcher state to FETCHING immediately before calling Dave> ct_send() in _FetchLazy.start(). Dave> In _FetchLazy.start() change: Dave> status = self._cmd.ct_send() Dave> to Dave> self._set_state(_LAZY_FETCHING) Dave> status = self._cmd.ct_send() This did... Thanks, Skip |
From: Andrew T. <and...@ap...> - 2004-12-20 20:28:18
|
I did notice another post about high memory usage. I too am experiencing the same thing. However eventually my machines runs out of physical and swap memory and then the script is terminated! :( Basically I have a script that is parsing around 2,000,000 rows of data. For every row, a field is extracted and then passed to a stored procedure to get some information back. Watching the process in top, I can see the memory increasing steadily. If I take out the Sybase stored procedure stuff and just hard code a value of the stored procedure output, the script runs to completion never using more than 4mb of memory. However with the Sybase query in, memory just steadily increases. PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 89567 ajt 112 0 21604K 19320K RUN 1:42 28.81% 28.81% python I'm running my script on Freebsd 5.3 using the port: py24-sybase-0.36_1 My script does the following: # connect to db db = Sybase.connect('dbhost', 'user', 'pass', 'db') # start for loop for text in fileinput.input("datafile"): # get cursor mnpcursor = db.cursor() # run stored proc mnpcursor.callproc('MnpMsisdn', [msisdn]) # get output row = mnpcursor.fetchone () # do stuff with row # close cursor mnpcursor.close () Is there are better way to be doing this or something I'm missing? Kind regards, ajt. -- ajt <and...@ap...> |
From: Andrew M. <an...@ob...> - 2004-12-14 21:44:13
|
> File "/usr/lib/python2.3/site-packages/Sybase.py", line 20, in ? > from sybasect import * >ImportError: libct.so.2: cannot open shared object file: No such file >or directory >----------------------- > >The output for "ldd /usr/lib/python2.3/site-packages/sybasect.so" is: > >----------------------- > libct.so.2 => not found > libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00a03000) > libc.so.6 => /lib/tls/libc.so.6 (0x00374000) > /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00929000) >----------------------- > >But the file "libct.so.2" is at "/usr/local/lib/". Here is the output >for "ll /usr/local/lib/libct.so*": You might want to try: LD_LIBRARY_PATH=/usr/local/lib python -ic "import Sybase" -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Hugo B. <hug...@gm...> - 2004-12-14 08:38:22
|
Sorry, I tried to install again, and now the error is different: ----------------------- Traceback (most recent call last): File "teste.py", line 4, in ? import Sybase File "/usr/lib/python2.3/site-packages/Sybase.py", line 20, in ? from sybasect import * ImportError: libct.so.2: cannot open shared object file: No such file or directory ----------------------- The output for "ldd /usr/lib/python2.3/site-packages/sybasect.so" is: ----------------------- libct.so.2 =3D> not found libpthread.so.0 =3D> /lib/tls/libpthread.so.0 (0x00a03000) libc.so.6 =3D> /lib/tls/libc.so.6 (0x00374000) /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x00929000) ----------------------- But the file "libct.so.2" is at "/usr/local/lib/". Here is the output for "ll /usr/local/lib/libct.so*": ----------------------- lrwxrwxrwx 1 root root 14 Dez 10 17:20 /usr/local/lib/libct.so -> libct.so.2.0.0 lrwxrwxrwx 1 root root 14 Dez 10 17:20 /usr/local/lib/libct.so.2 -> libct.so.2.0.0 -rwxr-xr-x 1 root root 792901 Dez 10 17:20 /usr/local/lib/libct.so.2.0.0 ----------------------- Thanks for any help! :) --=20 Hugo. ---------------------------------------------------------------------------= ------ "Do rio que tudo arrasta se diz que =E9 violento Mas ningu=E9m diz violentas as margens que o oprimem" Bertold Brecht - Sobre a viol=EAncia ---------------------------------------------------------------------------= ------ On Mon, 13 Dec 2004 13:08:12 +0000, Hugo Barbosa <hug...@gm...> w= rote: > Hi there, >=20 > I have just installed FreeTDS and it is working perfectly when I test > it usign tsql accessing a remote SQL Server 2000. Then I installed the > python-sybase module. But when I try to test with a python code, it > returns me an error in the very first command, "import Sybase". The > error is: >=20 > -------------------------- > Traceback (most recent call last): > File "teste.py", line 4, in ? > import Sybase > File "/usr/lib/python2.3/site-packages/Sybase.py", line 20, in ? > from sybasect import * > ImportError: /usr/lib/python2.3/site-packages/sybasect.so: undefined > symbol: cs_dt_info > -------------------------- >=20 > The output of the command "ldd /usr/lib/python2.3/site-packages/sybasect.= so" is: >=20 > -------------------------- > libpthread.so.0 =3D> /lib/tls/libpthread.so.0 (0x00f0c000) > libc.so.6 =3D> /lib/tls/libc.so.6 (0x00111000) > /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x0044a000) > -------------------------- >=20 > Can anybody help me ? Thanks. :) >=20 > -- > Hugo. >=20 > -------------------------------------------------------------------------= -------- > "Do rio que tudo arrasta se diz que =E9 violento > Mas ningu=E9m diz violentas as margens que o oprimem" >=20 > Bertold Brecht - Sobre a viol=EAncia > -------------------------------------------------------------------------= -------- > |
From: Hugo B. <hug...@gm...> - 2004-12-14 08:08:15
|
Hi there, I have just installed FreeTDS and it is working perfectly when I test it usign tsql accessing a remote SQL Server 2000. Then I installed the python-sybase module. But when I try to test with a python code, it returns me an error in the very first command, "import Sybase". The error is: -------------------------- Traceback (most recent call last): File "teste.py", line 4, in ? import Sybase File "/usr/lib/python2.3/site-packages/Sybase.py", line 20, in ? from sybasect import * ImportError: /usr/lib/python2.3/site-packages/sybasect.so: undefined symbol: cs_dt_info -------------------------- The output of the command "ldd /usr/lib/python2.3/site-packages/sybasect.so= " is: -------------------------- libpthread.so.0 =3D> /lib/tls/libpthread.so.0 (0x00f0c000) libc.so.6 =3D> /lib/tls/libc.so.6 (0x00111000) /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x0044a000) -------------------------- Can anybody help me ? Thanks. :) --=20 Hugo. ---------------------------------------------------------------------------= ------ "Do rio que tudo arrasta se diz que =E9 violento Mas ningu=E9m diz violentas as margens que o oprimem" Bertold Brecht - Sobre a viol=EAncia ---------------------------------------------------------------------------= ------ |
From: Jeff Y. <jyo...@of...> - 2004-12-01 18:06:21
|
This successfully builds a workable connector with sybase-12.5. It may not be the only way, but it definitely works. BUILD INSTRUCTIONS: setenv SYBASE /your/sybase-12.5/OCS/lib unsetenv LD_LIBRARY_PATH unsetenv LANG python setup.py install RUNTIME INSTRUCTIONS: setenv SYBASE /your/sybase-12.5 setenv LD_LIIBRARY_PATH /your/sybase-12.5/OCS/lib unsetenv LANG YOUR_PYTHON_THAT_DOES_include_Sybase - jeff younker |
From: John M. <joh...@gm...> - 2004-11-23 07:23:25
|
I've successfully used the Sybase module with earlier versions of Sybase. But now I get "Unresolved symbol: cs_ctx_alloc" with Sybase 12.5. Any suggestions? John $ SHLIB_PATH=/opt/sybase/OCS-12_5/lib $ python Python 2.3.4 (#2, Nov 20 2004, 10:57:57) [GCC 3.1 (TWW)] on hp-ux11 Type "help", "copyright", "credits" or "license" for more information. >>> import Sybase /usr/lib/dld.sl: Unresolved symbol: cs_ctx_alloc (code) from /home/brent/mudd/Python/lib/python2.3/site-packages/sybasect.sl ABORT instruction $ |
From: Dave C. <dj...@ob...> - 2004-11-16 18:37:53
|
Skip Montanaro wrote: > If a cursor's execute() method results in an error (say, from a trigger > failing for some reason) it appears there is no recourse to continue other > than closing the connection and starting over. Here's the simple test case: > > c = Sybase.Connection(...) > c1 = c.cursor() > c1.execute("select * from blah") > c2 = c.cursor() > c2.execute("select 1") > > The first execute() call results in a DatabaseError exception because there > is no column "blah". The second execute() call also fails with a > DatabaseError, this time in ct_send. The message is: > > ct_send(): user api layer: external error: This routine cannot be called > because another command structure has results pending. > > How do I toss those pending results? I've tried wrapping the c1 calls in > c.begin()/c.rollback() calls. I've tried closing and/or deleting c1. I've > tried fetching the nonexistent results of the failed execute() call. > Nothing seems to make Sybase happy again until a new connection is created. I think I know what is causing this. If someone could do an experiment for me I will make the change and cut a new release (with the output hook patch as well). The cursor class uses a _FetchLazy object to perform lazy fetching of rows from the server. The _FetchLazy object has an internal state which tracks the current state of the connection being used to fetch results. It is constructed in the IDLE state. Looking at the Cursor.execute() method: # Discard any previous results self._fetcher = None # Prepare to retrieve new results. fetcher = self._fetcher = _FetchLazy(self._owner) cmd = fetcher._cmd cmd.ct_command(CS_LANG_CMD, sql) for name, value in params.items(): buf = DataBuf(value) buf.name = name status = cmd.ct_param(buf) if status != CS_SUCCEED: fetcher._raise_error(Error, 'ct_param') self.description = fetcher.start(self.arraysize) If an exception is raised during either the ct_command() function or ct_send() the fetcher is still in the IDLE state. This means that when the next execute() is performed and the previous fetcher is discarded, no cancel action is performed. There are two possible ways to attempt a fix. 1) Construct the Fetcher in the FETCHING state. This will mean that any exception raised in the ct_command() or the ct_send() function will result in ct_cancel(CS_CANCEL_ALL) when the Fetcher is deleted. In _FetchLazy.__init__() change: self._state = _LAZY_IDLE to self._state = _LAZY_FETCHING 2) Set the Fetcher state to FETCHING immediately before calling ct_send() in _FetchLazy.start(). In _FetchLazy.start() change: status = self._cmd.ct_send() to self._set_state(_LAZY_FETCHING) status = self._cmd.ct_send() For various reasons I do not currently have a working Sybase server at the moment so would appreciate it if someone else could make the change and test for me. - Dave -- http://www.object-craft.com.au |
From: <gl...@so...> - 2004-11-14 00:24:00
|
That fixed it, thanks. > > > So far I have not been able to run a stored procedure. When > > I try the code snipped in the Sybase Module Manual, I get > > this output: > [...] > > File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 161, in _serv > > ermsg_cb > > raise DatabaseError(_fmt_server(msg)) > > Sybase.DatabaseError: Level 10, State 1, Procedure sp_help, Line 170 > > The problem here is that sp_help uses PRINT, which sends a message back > to the client. Currently, the python-sybase driver treats this message > type as a fatal error! > > I posted a patch to fix this and some other related problems last month, > but so far I have received no feedback. Is a new release planned soon? > > Anyway, you can look in the October list archives and try the patch from > my second email. It should fix it for you. > _______________________________________________ > Python-sybase mailing list > Pyt...@ww... > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase > |
From: Ty S. <ts...@sa...> - 2004-11-12 15:59:30
|
> So far I have not been able to run a stored procedure. When > I try the code snipped in the Sybase Module Manual, I get > this output: [...] > File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 161, in _serv > ermsg_cb > raise DatabaseError(_fmt_server(msg)) > Sybase.DatabaseError: Level 10, State 1, Procedure sp_help, Line 170 The problem here is that sp_help uses PRINT, which sends a message back to the client. Currently, the python-sybase driver treats this message type as a fatal error! I posted a patch to fix this and some other related problems last month, but so far I have received no feedback. Is a new release planned soon? Anyway, you can look in the October list archives and try the patch from my second email. It should fix it for you. |
From: <gl...@so...> - 2004-11-11 23:53:29
|
I am just getting started with python-sybase, so I apologize in advance if this is a silly question. So far I have not been able to run a stored procedure. When I try the code snipped in the Sybase Module Manual, I get this output: ============================================================================== Traceback (most recent call last): File "SybaseTest.py", line 58, in ? c.callproc( 'sp_help' ) File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 653, in callproc self.description = fetcher.start(self.arraysize, out_params) File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 338, in start return _FetchNow.start(self, arraysize) File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 264, in start status, result = self._cmd.ct_results() File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 161, in _servermsg_cb raise DatabaseError(_fmt_server(msg)) Sybase.DatabaseError: Level 10, State 1, Procedure sp_help, Line 170 ============================================================================== Can anyone suggest a solution to this, or someway that I can trace it to get more meaningful information? I am pretty sure that the problem is not at line 170 of sp_help. Thanks... GLJ (gl...@be...) |
From: Joshua G. <jo...@br...> - 2004-11-09 16:28:50
|
Hello -- I've been using the Sybase module 0.36 for a few months now, and it has been exceptionally helpful in our enterprise -- thank you so much for writing it! However, in developing a new bit of code this morning, I've spent all day banging my head against a wall trying to figure out what's causing this. I'm having to do some complex data mining, and so I've done a few "select into" statements, and now I'm trying to run a query against that new table. I'm selecting three columns out of one of these temporary tables, but when I run the fetchone method on my cursor, it returns (0,) -- a tuple of length one. Running my same query in Query Analyzer returns my results perfectly, so I'm pretty sure the query isn't the problem. Any thoughts? I've paged through the module code a little bit looking for what might be causing this, but I can't figure anything out. Thanks for any help you can provide. -jag -- Joshua Ginsberg <jo...@br...> Brainstorm Internet Network Operations |
From: Ty S. <ts...@sa...> - 2004-10-06 14:53:53
|
Oops, try this instead: --- Sybase.py.orig 2003-04-27 06:54:35.000000000 -0400 +++ Sybase.py 2004-10-05 15:01:02.000000000 -0400 @@ -129,6 +129,8 @@ def Binary(str): return str +_output_hooks = {} + def _fmt_server(msg): parts = [] for label, name in (('Msg', 'msgnumber'), @@ -157,8 +159,17 @@ raise DatabaseError(_fmt_client(msg)) def _servermsg_cb(ctx, conn, msg): - if msg.msgnumber not in (5701, 5703): - raise DatabaseError(_fmt_server(msg)) + mn = msg.msgnumber + if mn in (0, 5701, 5703, 5704) or ((mn >= 6200) and (mn < 6300)): + # Non-errors: + # 0 PRINT + # 5701 Changed db context + # 5703 Changed language + # 5704 Changed character set (Sybase) + # 6200-6299 SHOWPLAN output (Sybase) + _output_hooks.get(conn, lambda c,m: None)(conn, msg) + else: + raise DatabaseError(_fmt_server(msg)) def _row_bind(cmd, count = 1): '''Bind buffers for count rows of column data. @@ -838,6 +849,16 @@ finally: self._unlock() + def set_output_hook(self, hook): + if hook is None: + if _output_hooks.has_key(self._conn): + del _output_hooks[self._conn] + else: + _output_hooks[self._conn] = hook + + def get_output_hook(self, hook): + return _output_hooks.get(self._conn) + def __del__(self): try: self.close() _______________________________________________ Python-sybase mailing list Pyt...@ww... https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase |
From: Ty S. <ts...@sa...> - 2004-10-06 12:29:35
|
I've found the handling of messages to be a bit lacking. Currently some informational message numbers 5701 and 5703 (database changed, language changed) are ignored as harmless, but some others are treated as errors which should not be. I can't even connect to a Sybase 12.5.2 server because it returns 5704 (character set changed), and PRINT's and SHOWPLAN output are also treated as fatal errors. This is especially annoying in conjunction with the "once you get an error, you're done" bug (anyone made progress with that?) The following patch prevents those from raising errors, also adds an extension to let applications capture these informational messages, which I also have a use for. --- Sybase.py.orig 2003-04-27 06:54:35.000000000 -0400 +++ Sybase.py 2004-10-05 15:01:02.000000000 -0400 @@ -129,6 +129,8 @@ def Binary(str): return str +_output_hooks = {} + def _fmt_server(msg): parts = [] for label, name in (('Msg', 'msgnumber'), @@ -157,8 +159,17 @@ raise DatabaseError(_fmt_client(msg)) def _servermsg_cb(ctx, conn, msg): - if msg.msgnumber not in (5701, 5703): - raise DatabaseError(_fmt_server(msg)) + mn = msg.msgnumber + if mn in (0, 5701, 5703, 5704) or ((mn >= 6200) and (mn < 6300)): + # Non-errors: + # 0 PRINT + # 5701 Changed db context + # 5703 Changed language + # 5704 Changed character set (Sybase) + # 6200-6299 SHOWPLAN output (Sybase) + _output_hooks.get(conn, lambda c,m: None)(conn, msg) + else: + raise DatabaseError(_fmt_server(msg.text)) def _row_bind(cmd, count = 1): '''Bind buffers for count rows of column data. @@ -838,6 +849,16 @@ finally: self._unlock() + def set_output_hook(self, hook): + if hook is None: + if _output_hooks.has_key(self._conn): + del _output_hooks[self._conn] + else: + _output_hooks[self._conn] = hook + + def get_output_hook(self, hook): + return _output_hooks.get(self._conn) + def __del__(self): try: self.close() |
From: S. B. <ham...@gm...> - 2004-09-18 11:40:41
|
I am trying to import the module but I am getting the blk_alloc error. I've read the past link from a couple of months ago but I'm stumped now. The followin is in my environment export SYBASE = /apps/sybase export SYBASE_OCS = OCS-12_5 LD_LIBRARY_PATH=/apps/gcc/lib:$SYBASE/$SYBASE_OCS/lib:/usr/lib:/lib:/usr/local/lib python version 2.3.4 gcc 3.3 running install running build running build_py creating build creating build/lib.solaris-2.8-sun4u-2.3 copying Sybase.py -> build/lib.solaris-2.8-sun4u-2.3 running build_ext building 'sybasect' extension creating build/temp.solaris-2.8-sun4u-2.3 /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c datafmt.c -o build/temp.solaris-2.8-sun4u-2.3/datafmt.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c msgs.c -o build/temp.solaris-2.8-sun4u-2.3/msgs.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c blk.c -o build/temp.solaris-2.8-sun4u-2.3/blk.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c conn.c -o build/temp.solaris-2.8-sun4u-2.3/conn.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c numeric.c -o build/temp.solaris-2.8-sun4u-2.3/numeric.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c cmd.c -o build/temp.solaris-2.8-sun4u-2.3/cmd.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c datetime.c -o build/temp.solaris-2.8-sun4u-2.3/datetime.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c locale.c -o build/temp.solaris-2.8-sun4u-2.3/locale.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c sybasect.c -o build/temp.solaris-2.8-sun4u-2.3/sybasect.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c ctx.c -o build/temp.solaris-2.8-sun4u-2.3/ctx.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c iodesc.c -o build/temp.solaris-2.8-sun4u-2.3/iodesc.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c databuf.c -o build/temp.solaris-2.8-sun4u-2.3/databuf.o /apps/gcc/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/apps/sybase/OCS-12_0/include -I/home/sbaillar/opt/python/include/python2.3 -c money.c -o build/temp.solaris-2.8-sun4u-2.3/money.o /usr/local/bin/gcc -shared build/temp.solaris-2.8-sun4u-2.3/blk.o build/temp.solaris-2.8-sun4u-2.3/databuf.o build/temp.solaris-2.8-sun4u-2.3/cmd.o build/temp.solaris-2.8-sun4u-2.3/conn.o build/temp.solaris-2.8-sun4u-2.3/ctx.o build/temp.solaris-2.8-sun4u-2.3/datafmt.o build/temp.solaris-2.8-sun4u-2.3/iodesc.o build/temp.solaris-2.8-sun4u-2.3/locale.o build/temp.solaris-2.8-sun4u-2.3/msgs.o build/temp.solaris-2.8-sun4u-2.3/numeric.o build/temp.solaris-2.8-sun4u-2.3/money.o build/temp.solaris-2.8-sun4u-2.3/datetime.o build/temp.solaris-2.8-sun4u-2.3/sybasect.o -L/apps/sybase/OCS-12_0/lib -lsybdb -o build/lib.solaris-2.8-sun4u-2.3/sybasect.so running install_lib copying build/lib.solaris-2.8-sun4u-2.3/sybasect.so -> /home/sbaillar/opt/python/lib/python2.3/site-packages Which looks good...except when I try to do an import: Python 2.3.4 (#1, Aug 2 2004, 11:43:56) [GCC 2.95.3 20010315 (release)] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import Sybase Traceback (most recent call last): File "<stdin>", line 1, in ? File "Sybase.py", line 20, in ? from sybasect import * ImportError: ld.so.1: python: fatal: relocation error: file /home/sbaillar/opt/python/lib/python2.3/site-packages/sybasect.so: symbol blk_alloc: referenced symbol not found >>> Thanks, Sonny |
From: Josh C. <na...@gm...> - 2004-09-18 08:01:24
|
I'm using the smtplib module and I keep getting this error: (111, 'Connection refused') What could be causing this? I've tried it from a different computer and it seems to work, but not from this specific server. If port 25 was blocked for some reason, would that give me a 'connection refused' error? -Josh |