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...> - 2006-07-06 19:38:59
|
>> However, I suspect a more appropriate fix would be to factor out a >> _close_fetcher() method of Cursor: >> >> def _close_fetcher(self): >> if self._fetcher: >> self._fetcher._close() >> self._fetcher = None >> >> and replace every occurence of "self._fetcher = None" with >> "self._close_fetcher()". > >I have done this and it seems to work. I'm certainly not getting any >more mysterious "this routine cannot be called" errors from my >Python/sybase scripts, which makes me very happy indeed. > >I'll attach my patch. Does this look correct? Is it likely to be >included in a future release of python-sybase? Do you think I'll get >burned if I deploy a version of python-sybase with this patch applied? Dave's tied up with other stuff at the moment, but I've run this by him, and he says your patch looks good. As to whether it make it into a future release, I can certainly apply it to the repository, but neither Dave nor I have a Sybase installation to test it against at the moment (and neither of us can really spare the time). That raises the question - should the project be moved to Sourceforge? I'm not convinced the move would solve anything: it would still require at least one developer with C skills and the time to review and test patches, cut releases, and reply to queries - is there anyone on the list willing to commit to that? -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Greg W. <gwa...@py...> - 2006-07-06 14:23:25
|
On 05 July 2006, I said: > However, I suspect a more appropriate fix would be to factor out a > _close_fetcher() method of Cursor: > > def _close_fetcher(self): > if self._fetcher: > self._fetcher._close() > self._fetcher = None > > and replace every occurence of "self._fetcher = None" with > "self._close_fetcher()". I have done this and it seems to work. I'm certainly not getting any more mysterious "this routine cannot be called" errors from my Python/sybase scripts, which makes me very happy indeed. I'll attach my patch. Does this look correct? Is it likely to be included in a future release of python-sybase? Do you think I'll get burned if I deploy a version of python-sybase with this patch applied? Greg |
From: Greg W. <gwa...@py...> - 2006-07-06 10:02:56
|
On 22 June 2006, I said: > Back in May 2002, Ralph Heinkel reported a mysterious error, "This > routine cannot be called because another command structure has results > pending". Here's his post: > > http://www.object-craft.com.au/pipermail/python-sybase/2002-May/000034.html > > He posted a test program that reproduces the problem, and it still > reproduces perfectly for me. It appears that any error on a connection > renders that connection unusable, or at least un-commit()able and > un-rollback()able. I'm connecting to Sybase ASE 11.0.3.3 (using > libct.so and libcs.so supplied with the Sybase engine) and python-sybase > 0.37. I've done a bit more digging into this problem and discovered a crude workaround. All I have to do is add one line of code after my failed query but before closing the cursor: cur = db.cursor() try: # produce an error - THE TABLE 'DUMMY' DOES NOT EXIST cur.execute('select * from dummy') print "WTF?!? select should have failed!" except Sybase.Error, err: print "select failed as expected: %s" % err cur._fetcher._close() <--- CRUDE WORKAROUND cur.close() db.commit() That suggests to me that the bug lies in python-sybase rather than in my code or in ctlib. I think the bug is that Sybase.py assumes that self._fetcher = None is sufficient to close the fetcher object and release all of its resources, most importantly by calling ct_cancel() on the underlying ctlib command structure. Here's a narrow-minded patch that fixes the particular problem I'm seeing: --- Sybase.py.orig 2005-04-06 18:46:43.000000000 -0400 +++ Sybase.py.hacked 2006-07-05 12:41:55.000000000 -0400 @@ -735,10 +735,12 @@ def close(self): '''DB-API Cursor.close() ''' if self._closed: raise ProgrammingError('cursor is closed') + if self._fetcher: + self._fetcher._close() self._fetcher = None self._closed = 1 def execute(self, sql, params = {}): '''DB-API Cursor.execute() However, I suspect a more appropriate fix would be to factor out a _close_fetcher() method of Cursor: def _close_fetcher(self): if self._fetcher: self._fetcher._close() self._fetcher = None and replace every occurence of "self._fetcher = None" with "self._close_fetcher()". Does this sound close? If so, I'll happily provide a patch. Greg |
From: Mr. D. <bit...@ho...> - 2006-06-24 11:51:46
|
Hi, We are running SLES 9.3 with AMD64. I'm getting these errrors, after try to make a simple connection to sybase followed by a simple query that works fine with perl code or going in with isql. There is some problem with the way php 5.1.4 is compiling here. My confiure scirpt is below. Leaving out the clfags and DSYB_LB64 doesn't improve these results. I can't find any posts on this error message, so if any one has a clue my php 5.1.4 wouldn't work with the OCS-15_0 or this is some other problem....Please share. I can get rid of the utf8 errors with export LANG=en_US, so that's not a problem, but the script isn't pulling the relsult off the database, even though these are just warnings. Thanks, ~DjK ## the php script $link = sybase_connect('xxx5003', 'xxx_user', 'xxx') or die("Could not connect !"); echo "Connected successfully\ n"; sybase_select_db('systems',$link) or die ("Could net set database to systems!"); echo "DB selected successfully\n"; sybase_close($link); ?> ## the output arning: sybase_connect(): Sybase: Server message: base context to 'systems'. (severity 543450471, procedure ) in /prj/web/www123/htdocs/josh.php on line 2 PHP Warning: sybase_connect(): Sybase: Server message: the requested character set in Syscharsets: name = 'utf8'. (severity 1713402991, procedure ) in /prj/web/www123/htdocs/josh.php on line 2 PHP Warning: sybase_connect(): Sybase: Server message: ns will be done. (severity 1702260335, procedure ) in /prj/web/www123/htdocs/josh.php on line 2 PHP Warning: sybase_connect(): Sybase: Server message: base context to 'systems'. (severity 543450471, procedure ) in /prj/web/www123/htdocs/josh.php on line 2 Connected successfully PHP Warning: sybase_select_db(): Sybase: Server message: base context to 'systems'. (severity 543450471, procedure ) in /prj/web/www123/htdocs/josh.php on line 6 Could net set database to systems! ## the configuration :/usr/local/src/php-5.1.4> CFLAGS="${CFLAGS} -g -DSYB_LP64" ./configure --prefix=/usr/local/php-5.1.4/ --with-apxs2=/usr/local/apache-2.2.0/bin/apxs --with-libxml-dir=/usr/local --without-mysql --without-sqlite --with-pgsql=/usr/local/pgsql.production/ --with-sybase-ct=/usr/local/sybase.production/OCS-15_0/ |
From: Greg W. <gwa...@py...> - 2006-06-23 12:54:34
|
Back in May 2002, Ralph Heinkel reported a mysterious error, "This routine cannot be called because another command structure has results pending". Here's his post: http://www.object-craft.com.au/pipermail/python-sybase/2002-May/000034.html He posted a test program that reproduces the problem, and it still reproduces perfectly for me. It appears that any error on a connection renders that connection unusable, or at least un-commit()able and un-rollback()able. I'm connecting to Sybase ASE 11.0.3.3 (using libct.so and libcs.so supplied with the Sybase engine) and python-sybase 0.37. Here's my slight variation on Ralph's test program: -- syberror ------------------------------------------------------------ #!/usr/bin/python # Attempt to reproduce the mysterious "This routine cannot be called # because another command structure has results pending." error. # # Based on code seen in this mailing list post: # http://www.object-craft.com.au/pipermail/python-sybase/2002-May/000034.html import sys import Sybase Sybase._ctx.debug = 1 args = sys.argv[1:] if len(args) != 3: sys.exit("usage: syberror server username password") (server, username, password) = args db = Sybase.connect(server, username, password) print "successfully connected to %s" % server cur = db.cursor() try: # produce an error - THE TABLE 'DUMMY' DOES NOT EXIST cur.execute('select * from dummy') print "WTF?!? select should have failed!" except Sybase.Error, err: print "select failed as expected: %s" % err cur.close() db.commit() ------------------------------------------------------------------------ The most important change is that I added "_ctx.debug = 1", as requested by Dave Cole in a followup. And here is the output I get from running this program (username and password censored): ------------------------------------------------------------------------ ct_con_alloc(ctx0, &conn) -> CS_SUCCEED, conn0 ct_con_props(conn0, CS_SET, CS_USERNAME, "***", CS_NULLTERM, NULL) -> CS_SUCCEEDct_con_props(conn0, CS_SET, CS_PASSWORD, "********", CS_NULLTERM, NULL) -> CS_SUCCEED servermsg_cb ct_connect(conn0, "MIRA321", CS_NULLTERM) -> CS_SUCCEED ct_options(conn0, CS_SET, CS_OPT_CHAINXACTS, 1, CS_UNUSED, NULL) -> CS_SUCCEED successfully connected to MIRA321 Cursor.execute _lock: count -> 1 ct_cmd_alloc(conn0, &cmd) -> CS_SUCCEED, cmd0 _lock: count -> 2 _set_state: _LAZY_IDLE _unlock: count -> 1 ct_command(cmd0, CS_LANG_CMD, "select * from dummy", CS_NULLTERM, CS_UNUSED) -> CS_SUCCEED _set_state: _LAZY_FETCHING ct_send(cmd0) -> CS_SUCCEED _start_results servermsg_cb Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'dummy'. ct_results(cmd0, &result) -> CS_SUCCEED, CS_CMD_FAIL select failed as expected: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'dummy'. ct_cmd_alloc(conn0, &cmd) -> CS_SUCCEED, cmd1 ct_command(cmd1, CS_LANG_CMD, "commit transaction", CS_NULLTERM, CS_UNUSED) -> CS_SUCCEED clientmsg_cb Layer: 1, Origin: 1 ct_send(): user api layer: external error: This routine cannot be called because another command structure has results pending.ct_send(cmd1) -> CS_FAIL ct_cancel(conn0, NULL, CS_CANCEL_ALL) -> CS_SUCCEED _unlock: count -> 0 ct_cmd_drop(cmd0) -> CS_SUCCEED Traceback (most recent call last): File "./syberror", line 30, in ? db.commit() File "/usr/local/Intelerad/3rd_Party/python/lib/python2.3/site-packages/Sybase.py", line 971, in commit self.execute('commit transaction') File "/usr/local/Intelerad/3rd_Party/python/lib/python2.3/site-packages/Sybase.py", line 996, in execute fetcher.start(self.arraysize) File "/usr/local/Intelerad/3rd_Party/python/lib/python2.3/site-packages/Sybase.py", line 307, in start status = self._cmd.ct_send() File "/usr/local/Intelerad/3rd_Party/python/lib/python2.3/site-packages/Sybase.py", line 184, in _clientmsg_cb raise DatabaseError(_fmt_client(msg)) Sybase.DatabaseError: Layer: 1, Origin: 1 ct_send(): user api layer: external error: This routine cannot be called because another command structure has results pending. ct_cmd_drop(cmd1) -> CS_SUCCEED ct_con_props(conn0, CS_GET, CS_CON_STATUS, &value, CS_UNUSED, NULL) -> CS_SUCCEED, CS_CONSTAT_CONNECTED ct_close(conn0, CS_FORCE_CLOSE) -> CS_SUCCEED ct_con_drop(conn0) -> CS_SUCCEED ------------------------------------------------------------------------ Does anyone understand what's going on here? For the longest time, I have assumed this was a subtle bug in my code, but now that I have this simple test script I really doubt that. How can one error make it impossible to commit() or rollback() the current transaction? (Same result if the last line is db.rollback(), by the way.) Is this a bug in python-sybase? or in ctlib? or elsewhere? Thanks -- Greg |
From: Dominic F. <dom...@gm...> - 2006-06-20 02:23:32
|
Hi, I'm having a problem retrieving certain numeric values from a Sybase ASA 8 database using the Python Sybase module with FreeTDS. Some of the values returned from a simple "select * from foo" query on a table in this database show up as NumericTypes with a scale and precision of 0, and throw a "numeric to string conversion failed" error when you try to do anything with them. The actual values appear to be currency values, e.g. 5.00. The FreeTDS command-line tool, tsql, has no trouble with them. Any idea what the problem might be, and whether a fix might be possible? Dominic |
From: Mr. D. <bit...@ho...> - 2006-06-02 09:03:49
|
I have problems getting sybase-0.37 to work with either the 32-bit version of OCS, 11 or the 64-bit version, 15. Things work with tsql or isql, but with python, I'm gettig segfault or undefined symbol. Does anyone know of a combination that does work? I have linuxamd64 with OCS_15 (64-bit). I also found rpms for the version 11 sybase OCS. Freetds-.63 with sybase-0.37 results in the segfault. ## One post says... If python is built in 64bit mode then it HAS to use the 64bit Sybase libs. However I suspect that the python Sybase glue code hasn't been modified to handle the changes required to link/build with the 64bit libs - in particular including the -DSYB_LP64 command line arg to gcc when compiling the C code, and linking with the xxx64 version of the libs. |
From: Mr. D. <bit...@ho...> - 2006-06-01 09:51:21
|
Hi, I have freetds-0.63 installed. Also, I have python 2.3.5. I have LANG=en_US. I also tried LANG= and LANG=C. SYBASE=/usr/local/freetds and the interfaces file is there. In the python module I can import Sybase, sys & string, but then I get a segmentation fault. /local/freetds /usr/local/freetds> python Python 2.3.5 (#8, Mar 24 2005, 08:32:27) [GCC 3.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>import Sybase >>>import sys >>>import string >>>db=Sybase.connect('peach5027d','admin','passwd') Segmentation fault Thanks for any help, ~D |
From: Mr. D. <bit...@ho...> - 2006-06-01 06:47:54
|
Hi, My environment is AMD 64-bit opteron with SLES 9.3. What version of sybase OCS will work with python 2.3.5? I had version 15, the latest OCS from sybase, and python was asking for libraries like insck that were only in older version of Sybase OCS. My theory is that the 64-bit version of python only works with the 32-bit version of sybase open client, like 12.5.1 not 15. Has any one had a similiar experience? Does any one know where to get a version of sybase open client that will work with python 2.3.5? Meaning, python will be then able to query a 11.9.2 ASE. I'm thinking of ditching OCS all together and using freetds with python instead. Is it right to say that if you have freetds, then you don't need any version of sybase(ie OCS-15_0, OCS-12_5_1 )? Thanks! ~DjK |
From: Norbert S. <seb...@gm...> - 2006-05-27 23:00:57
|
Hi! I got this exception: File "/home/fviktor/dbsync/webexport_mag.py", line 12, in ? db=3D Sybase.connect(server,user,passw,database) File "/usr/local/lib/python2.4/site-packages/Sybase.py", line 1005, in con= nect strip, auto_commit, delay_connect, locking) File "/usr/local/lib/python2.4/site-packages/Sybase.py", line 867, in __in= it__ self.connect() File "/usr/local/lib/python2.4/site-packages/Sybase.py", line 886, in conn= ect status =3D conn.ct_connect(self.dsn) File "/usr/local/lib/python2.4/site-packages/Sybase.py", line 200, in _servermsg_cb raise DatabaseError(_fmt_server(msg)) DatabaseError: Msg 4017, Level 16, State 1 Neither language name in login record '=8A09999=F5=DF=C2x' nor language nam= e in syslogins '<NULL>' is an official language name on this SQL Server. Using server-wide default 'us_english' instead. It's maybe like this thread: http://www.object-craft.com.au/pipermail/python-sybase/2006-March/000463.ht= ml I'm using FreeTDS too, I tried to drop the error: try: db=3D Sybase.connect(server,user,passw,database) except: pass but the db object doesn't exist after try-except. What can be the solution? |
From: Mr. D. <bit...@ho...> - 2006-05-27 10:52:14
|
Hi everyone, I've seen a post on this before, but changing the libraries for linux in setup.py to have syb didn't help me. I have installed OCS-15_0 (the linuxamd64 sdk purchase from sybase) I also have sybperl-2.18, freetds-.63, DBD-Sybase 1.07 installed, python-2.3.5 After installing sybase-0.37, I'm trying to get past this error when I go into the python shell. I would like to use python to make a query to our ASE 11.9.2 server. However, the sybase module for python sybase-0.37 is unable to 'import Sybase' Open Client libraries(OCS-15_0). There is no error during the build or installation, but I get this error when I try to import Sybase. :/usr/local/sybase.production/OCS-15_0> python Python 2.3.5 (#8, Mar 24 2005, 08:32:27) [GCC 3.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. import Sybase Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 20, in ? from sybasect import * ImportError: /usr/local/lib/python2.3/site-packages/sybasect.so: undefined symbol: cs_dt_info :/usr/local/src> ldd /usr/local/lib/python2.3/site-packages/sybasect.so libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a9567e000) libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95792000) /lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000) Thanks for any help, ~DjK |
From: Eduardo Gonzalez-S. <eg...@as...> - 2006-05-18 06:12:37
|
Hi, When trying to compile the sybase module using ASE15 I was getting: > python -c "import sybasect" Traceback (most recent call last): File "<string>", line 1, in ? ImportError: ./sybasect.so: undefined symbol: cs_dt_info The problem is that ASE15 has renamed their libraries (probably because of conflicting names with other system libraries) so that e.g. libblk.a in ASE12.5 is now libsybblk.a. My fix: --- setup.py.orig 2006-05-17 14:09:45.000000000 +0100 +++ setup.py 2006-05-17 14:10:13.000000000 +0100 @@ -45,7 +45,7 @@ # On Linux the Sybase tcl library is distributed as sybtcl syb_libs = [] if os.uname()[0] == 'Linux': - lib_names = ['blk', 'ct', 'cs', 'sybtcl', 'insck', 'comn', 'intl'] + lib_names = ['sybblk', 'sybct', 'sybcs', 'sybtcl', 'sybinsck', 'sybcomn', 'sybintl'] elif os.uname()[0] == 'AIX': lib_names = ['blk', 'ct', 'cs', 'comn', 'tcl', 'intl', 'insck'] else: (beware of line breaks due to emailer) works for me. Hope it helps, Eduardo. |
From: <sab...@gm...> - 2006-05-10 02:33:16
|
Hi, there is a small bug in cmd.c which generates a core dump when ct_param is called with a datafmt object in debug mode. Here is a patch to correct this trivial problem: diff -ru original/sybase-0.37/cmd.c sybase-0.37-ssa/cmd.c --- original/sybase-0.37/cmd.c 2005-03-21 06:13:55.000000000 +0100 +++ sybase-0.37-ssa/cmd.c 2006-05-09 11:23:35.000000000 +0200 @@ -788,7 +788,7 @@ SY_CONN_END_THREADS(self->conn); if (self->debug) { - debug_msg("ct_param(cmd%s, &fmt=3D", self->serial); + debug_msg("ct_param(cmd%d, &fmt=3D", self->serial); datafmt_debug(&datafmt->fmt); debug_msg(", NULL, CS_UNUSED, CS_UNUSED) -> %s\n", value_str(VAL_STATUS, status)); regards -- S=E9bastien Sabl=E9 |
From: mike <mik...@gm...> - 2006-04-21 19:55:12
|
hi i am trying to connect to my replication server using rep =3D connect(Svr, login,Pass ) but i got the error message "No SRV_OPTION handler installed" What could i do to remedy this problem. thanks |
From: mike <mik...@gm...> - 2006-04-10 19:52:59
|
hi i am using Python sybase module 0.37. recently i encountered "Character or binary data returned from Adaptive Server has been truncated. The client application does not support more than 255 bytes of data as a result column or output parameter." when i call a stored procedure. What can be a workaround for this? thanks for your assistance |
From: <sab...@gm...> - 2006-04-08 05:37:01
|
Hi, first thanks for the Sybase python module, it has been very useful to me so= far. I have a problem however with concurrency in the DBAPI version of the API. I am trying to call an UPDATE query nested in a SELECT with two cursors. Here is a test case to illustrate the problem: from unittest import TestCase, main import Sybase class TestConcurrency(TestCase): def setUp(self): conn =3D Sybase.connect('MYSERVER', MYLOGIN', 'MYPASSWD', auto_comm= it=3D1) c1 =3D conn.cursor() try: c1.execute("DROP TABLE Foo") except: pass conn.close() def test01(self): conn =3D Sybase.connect('MYSERVER', 'MYLOGIN', 'MYPASSWD', auto_com= mit=3D1) c1 =3D conn.cursor() c1.execute("CREATE TABLE Foo (id INT, name VARCHAR(15), PRIMARY KEY (id))") c1.execute("INSERT INTO Foo (id, name) VALUES ( 1, 'foo')") c1.execute("INSERT INTO Foo (id, name) VALUES ( 2, 'bar')") c1.execute("SELECT id, name FROM Foo") s =3D [c1.fetchone()] c2 =3D conn.cursor() # the test fails here because of pending results c2.execute("UPDATE Foo SET name =3D 'foobar' WHERE id =3D 2") s +=3D [c1.fetchone()] self.assertEqual(s, [(1, 'foo'), (2, 'bar')]) conn.close() if __name__ =3D=3D '__main__': main() When running this test, I get the following exception: DatabaseError: Layer: 1, Origin: 1 ct_send(): user api layer: external error: This routine cannot be called because another command structure has results pending. The open client documentation tells that it is possible to do some nested cursor commands in some cases: http://manuals.sybase.com/onlinebooks/group-cn/cng1251e/clcprgde/@ebt-link;= pt=3D8207;lang=3Dfr?target=3D%25N%14_9567_START_RESTART_N%25 And indeed I have been able to do something like that using the sybasect API. But I would really prefer to be able to use DBAPI. I tried to look further for the problem and realized that the Sybase module is never using ct_cursor to handle cursors but it actually calls ct_command. So is there some way to do what I am trying to do with the Sybase DBAPI or should I use sybasect? Thanks in advance regards -- S=E9bastien Sabl=E9 |
From: Grant M. <gmc...@in...> - 2006-04-07 17:00:45
|
Mike, Firstly may I point you to the documentation?: http://www.object-craft.com.au/projects/sybase/sybase/ It should answer most of your questions. Secondly, on the cursor object is a method named nextset() this is what you want. The documentation contains a full description of what this method does. Grant -----Original Message----- From: pyt...@ww... [mailto:pyt...@ww...]On Behalf Of mike Sent: Thursday, April 06, 2006 7:21 PM To: Python Sybase Subject: [python-sybase] Sybase stored procs question hi I have a Sybase stored proc that was coded such that it returns a number of "select" statements to the caller. eg select 'Begin Processing...' ... select 'Transaction finished' I have tried to call this procedures using execute or callproc methods, but was only able to return the first result ie 'Begin Processing' , using fetchall. How can i catch all "select" outputs.. thanks _______________________________________________ Python-sybase mailing list Pyt...@ww... https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase |
From: mike <mik...@gm...> - 2006-04-07 02:21:08
|
hi I have a Sybase stored proc that was coded such that it returns a number of "select" statements to the caller. eg select 'Begin Processing...' ... select 'Transaction finished' I have tried to call this procedures using execute or callproc methods, but was only able to return the first result ie 'Begin Processing' , using fetchall. How can i catch all "select" outputs.. thanks |
From: Bradley F. <br...@re...> - 2006-03-22 21:03:33
|
I was just going to say the same thing. That's exactly what I do. -----Original Message----- From: Chris Curvey [mailto:cc...@gm...] Sent: Tuesday, March 21, 2006 9:01 PM To: Dav...@as... Cc: pyt...@ww... Subject: Re: [python-sybase] connection exception You're connecting just fine. Sybase is sending back an error message telling you what character set and database you are using. You'll have to trap for that and just drop the "error" On 3/21/06, David Bear <Dav...@as...> wrote: I am using freetds instead of sybase to connect to our sybase server. ========== d = Sybase.connect('ASU_DATA_WAREHOUSE', 'user', 'pw') Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib64/python2.4/site-packages/Sybase.py", line 1005, in connect strip, auto_commit, delay_connect, locking) File "/usr/lib64/python2.4/site-packages/Sybase.py", line 867, in __init__ self.connect() File "/usr/lib64/python2.4/site-packages/Sybase.py", line 886, in connect status = conn.ct_connect(self.dsn) File "/usr/lib64/python2.4/site-packages/Sybase.py", line 200, in _servermsg_cb raise DatabaseError(_fmt_server(msg)) Sybase.DatabaseError: Msg 4294973000, Level 10, State 1 Changed client character set setting to 'iso_1'. Msg 8589940293, Level 10, State 2 Changed database context to 'DICTIONARY'. =============== the connection object never gets made. Can anyone shed light on what this error means? I am able to connect using freetds tsql command. -- David Bear phone: 480-965-8257 fax: 480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 "Beware the IP portfolio, everyone will be suspect of trespassing" _______________________________________________ Python-sybase mailing list Pyt...@ww... https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase <https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase> -- Nervous passengers are advised to wear a blindfold. |
From: Chris C. <cc...@gm...> - 2006-03-22 21:01:33
|
You're connecting just fine. Sybase is sending back an error message telling you what character set and database you are using. You'll have to trap for that and just drop the "error" On 3/21/06, David Bear <Dav...@as...> wrote: > > I am using freetds instead of sybase to connect to our sybase server. > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > d =3D Sybase.connect('ASU_DATA_WAREHOUSE', 'user', 'pw') > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/usr/lib64/python2.4/site-packages/Sybase.py", line 1005, in > connect > strip, auto_commit, delay_connect, locking) > File "/usr/lib64/python2.4/site-packages/Sybase.py", line 867, in > __init__ > self.connect() > File "/usr/lib64/python2.4/site-packages/Sybase.py", line 886, in > connect > status =3D conn.ct_connect(self.dsn) > File "/usr/lib64/python2.4/site-packages/Sybase.py", line 200, in > _servermsg_cb > raise DatabaseError(_fmt_server(msg)) > Sybase.DatabaseError: Msg 4294973000, Level 10, State 1 > Changed client character set setting to 'iso_1'. > Msg 8589940293, Level 10, State 2 > Changed database context to 'DICTIONARY'. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > the connection object never gets made. Can anyone shed light on what > this error means? I am able to connect using freetds tsql command. > > -- > David Bear > phone: 480-965-8257 > fax: 480-965-9189 > College of Public Programs/ASU > Wilson Hall 232 > Tempe, AZ 85287-0803 > "Beware the IP portfolio, everyone will be suspect of trespassing" > _______________________________________________ > Python-sybase mailing list > Pyt...@ww... > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase > -- Nervous passengers are advised to wear a blindfold. |
From: David B. <Dav...@as...> - 2006-03-22 20:56:10
|
I am using freetds instead of sybase to connect to our sybase server. ========== d = Sybase.connect('ASU_DATA_WAREHOUSE', 'user', 'pw') Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib64/python2.4/site-packages/Sybase.py", line 1005, in connect strip, auto_commit, delay_connect, locking) File "/usr/lib64/python2.4/site-packages/Sybase.py", line 867, in __init__ self.connect() File "/usr/lib64/python2.4/site-packages/Sybase.py", line 886, in connect status = conn.ct_connect(self.dsn) File "/usr/lib64/python2.4/site-packages/Sybase.py", line 200, in _servermsg_cb raise DatabaseError(_fmt_server(msg)) Sybase.DatabaseError: Msg 4294973000, Level 10, State 1 Changed client character set setting to 'iso_1'. Msg 8589940293, Level 10, State 2 Changed database context to 'DICTIONARY'. =============== the connection object never gets made. Can anyone shed light on what this error means? I am able to connect using freetds tsql command. -- David Bear phone: 480-965-8257 fax: 480-965-9189 College of Public Programs/ASU Wilson Hall 232 Tempe, AZ 85287-0803 "Beware the IP portfolio, everyone will be suspect of trespassing" |
From: mike <mik...@gm...> - 2006-02-09 10:28:23
|
hi how can i bulk copy (much like the bcp command ) out a Sybase table using the Python Sybase module?. any examples that i can learn from? thanks |
From: Camillo P. (TUSC) <cpe...@tu...> - 2006-01-12 17:24:49
|
Adam, A big thank you!!. That has done the trick. Python 2.4.1 (#1, Sep 13 2005, 00:39:20) [GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Sybase >>> vars() {'__builtins__': <module '__builtin__' (built-in)>, '__file__': '/etc/pythonstart', 'Sybase': <module 'Sybase' from '/usr/lib/python2.4/site-packages/Sybase.pyc'>, '__name__': '__main__', '__doc__': None} Regards, Camillo On Wed, 2006-01-11 at 07:22 -0500, Adam Hooper wrote: > On Wed, 2006-01-11 at 13:17 +1100, Camillo Pereira (TUSC) wrote: > > >>> import Sybase > > Traceback (most recent call last): > > File "<stdin>", line 1, in ? > > File "/usr/lib/python2.4/site-packages/Sybase.py", line 20, in ? > > from sybasect import * > > ImportError: libct.so.4: cannot open shared object file: No such file or > > directory > > Try adding "/usr/local/freetds/lib" to /etc/ld.so.conf and running > "ldconfig". > |
From: Adam H. <ad...@de...> - 2006-01-12 07:20:11
|
On Wed, 2006-01-11 at 13:17 +1100, Camillo Pereira (TUSC) wrote: > >>> import Sybase > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/usr/lib/python2.4/site-packages/Sybase.py", line 20, in ? > from sybasect import * > ImportError: libct.so.4: cannot open shared object file: No such file or > directory Try adding "/usr/local/freetds/lib" to /etc/ld.so.conf and running "ldconfig". --=20 Adam Hooper <ad...@de...> |
From: Camillo P. (TUSC) <cpe...@tu...> - 2006-01-11 21:16:35
|
Hi, I have installed FreeTDS v0.64.dev.20060110 successfully and then compiled the sybase module 0.37. The problem occures when I try to import Sybase: >>> import Sybase Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/Sybase.py", line 20, in ? from sybasect import * ImportError: libct.so.4: cannot open shared object file: No such file or directory I noticed that a similar problem was experienced by Hugo at the posting on http://www.object-craft.com.au/pipermail/python-sybase/2004-December/000344.html but no resolution was posted. I had also tried using FreeTDS(0.63) with the same error, however it was looking for libct.so.3. STEPS CARRIED OUT: => Installing FreeTDS # ./configure --disable-odbc --disable-libiconv --enable-sybase-compat --prefix=/usr/local/freetds # make; make install; make clean => Installing Sybase python module # export SYBASE=/usr/local/freetds # python setup.py build_ext -D HAVE_FREETDS Am I missing something during the build stage of the sybase module?? Any pointers would be much appreciated. Regards, -- Camillo Pereira |