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 L. <and...@gm...> - 2011-02-05 09:43:46
|
Michał Sawicz <michal <at> sawicz.net> writes: I've reproduced all your results :) According python dir() function output, ct_cursor doesn't exists for sure :) May be something changed in Sybase client libraries? I've used sa12_client_linux_x86.x64.1200_2483.tar.gz from Sybase home site. With Python-mssql, there is no any way to make it use CT-library. DB-library looks like doesn't works with SQL Anywhere 12 any more. I didn't find a working example at least. Maybe we could debug python-sybase code and find solution, but as for me, it's gonna be too expansive for my small DB converter task. So I decided to use native Sybase module: http://dcx.sybase.com/index.html#1200en/dbprogramming/pg-python.html. Works perfect for me. Don't know why I didn't try it first :\ Hope it would be useful for you too :) Best regards, Andrew Lazarev |
From: Michał S. <mi...@sa...> - 2011-02-04 10:35:51
|
Dnia 2011-02-04, pią o godzinie 10:09 +0000, Andrew Lazarev pisze: > Did you solve you problem already? I did work around that particular problem but have another issue, you can read my followup here: http://sourceforge.net/mailarchive/message.php?msg_id=26997237 Cheers, -- Michał Sawicz <mi...@sa...> |
From: Andrew L. <and...@gm...> - 2011-02-04 10:15:20
|
I have the same problems with Debian lenny too. I can connect to DB with external console (sqsh in my variant) as you are. With FreeTDS debug feature I found that sqsh use CT-library for connections but python-mssql use DB-library. Probably, there is some way to make python-mssql to use CT-library? I don't know yet. With python-sybase I have the same problems, except that I can make it with -D HAVE_FREETDS, receiving no errors. But "undefined symbol: cs_config" is still there. Did you solve you problem already? |
From: Michał S. <mi...@sa...> - 2011-02-02 12:32:33
|
Hi again, I worked around the linking problem by exporting LD_PRELOAD=/usr/lib/libct.so before starting python. So now I can import the module and even connect to the database, but as soon as I want to SELECT something, the following exception is thrown: > $ LD_PRELOAD=/usr/lib/libct.so ipython > Python 2.5.2 (r252:60911, Jan 24 2010, 14:53:14) > Type "copyright", "credits" or "license" for more information. > > IPython 0.8.4 -- An enhanced Interactive Python. > ? -> Introduction and overview of IPython's features. > %quickref -> Quick reference. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > In [1]: import logging > > In [2]: logging.basicConfig() > > In [3]: import Sybase > > In [4]: Sybase.DEBUG = True > > In [5]: db = Sybase.connect('ara', 'DBA', 'SQL') > DEBUG:sybase:locking > DEBUG:sybase:unlocking > > In [6]: db.execute('SELECT * FROM ABONAMENT;') > DEBUG:sybase:locking > DEBUG:sybase:locking > DEBUG:sybase:Cursor(163722924): execute 'SELECT * FROM ABONAMENT;' with {} > DEBUG:sybase:locking > DEBUG:sybase:Cursor(163722924): allocate ct_cursor > DEBUG:sybase:unlocking > DEBUG:sybase:unlocking > DEBUG:sybase:unlocking > --------------------------------------------------------------------------- > AttributeError Traceback (most recent call last) > > /home/msawicz/<ipython console> in <module>() > > /usr/lib/python2.5/site-packages/python_sybase-0.40pre1-py2.5-linux-i686.egg/Sybase.pyc in execute(self, sql) > 1227 try: > 1228 cursor = self.cursor() > -> 1229 cursor.execute(sql) > 1230 cursor.close() > 1231 finally: > > /usr/lib/python2.5/site-packages/python_sybase-0.40pre1-py2.5-linux-i686.egg/Sybase.pyc in execute(self, sql, params, select) > 692 if DEBUG: log.debug("%r: execute %r with %r" % (self, sql, params)) > 693 if sql is not None and sql != self._sql: > --> 694 self.prepare(sql, select=select) > 695 else: > 696 # Re-execute same request > > /usr/lib/python2.5/site-packages/python_sybase-0.40pre1-py2.5-linux-i686.egg/Sybase.pyc in prepare(self, sql, select) > 497 # _ctx.debug_msg("using ct_cursor, %s\n" % sql) > 498 if DEBUG: log.debug("%r: allocate ct_cursor" % self) > --> 499 status = self._cmd.ct_cursor(CS_CURSOR_DECLARE, "ctmp%x" % id(self), sql, CS_UNUSED) > 500 if status != CS_SUCCEED: > 501 self._raise_error(Error('ct_cursor declare')) > > AttributeError: ct_cursor > > In [7]: When exiting, an additional error: > In [8]: > Do you really want to exit ([y]/n)? y > DEBUG:sybase:Cursor(163722924): close > Exception exceptions.AttributeError: 'ct_cursor' in <bound method Cursor.__del__ of Cursor(163722924)> ignored That's on both Debian Lenny and Sid, python-sybase-0.39 and -0.40pre1, freetds-0.82, python-2.5.2 and -2.6.6, Sybase (ASA) 9.0.1.1753. Any possible solutions? For both, actually - the linking issue and the ct_cursor AttributeError? Best regards -- Michał Sawicz <mi...@sa...> |
From: Michał S. <mi...@sa...> - 2011-01-26 00:05:18
|
Dnia 2011-01-25, wto o godzinie 17:46 -0600, Robert Boehne pisze: > This symbol is defined by the ct library from Sybase, in your case > you're replacing that with the freetds version. > So, you may not have linked to freetds properly, or you may just need > to add the directory where your freetds binaries are to > LD_LIBRARY_PATH. I suppose the linking's wrong - libct.so iBs missing: > $ ldd /usr/local/lib/python2.6/dist-packages/python_sybase-0.40pre1-py2.6-linux-i686.egg/sybasect.so > linux-gate.so.1 => (0xffffe000) > libpthread.so.0 => /lib/libpthread.so.0 (0xb8017000) > libc.so.6 => /lib/libc.so.6 (0xb7ed1000) > /lib/ld-linux.so.2 (0xb8053000) But that suggests it's a problem in setup.py, no? here's a log from build_ext: > $ python setup.py build_ext -DHAVE_FREETDS > running build_ext > building 'sybasect' extension > creating build > creating build/temp.linux-i686-2.6 > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c blk.c -o build/temp.linux-i686-2.6/blk.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c databuf.c -o build/temp.linux-i686-2.6/databuf.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c cmd.c -o build/temp.linux-i686-2.6/cmd.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c conn.c -o build/temp.linux-i686-2.6/conn.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c ctx.c -o build/temp.linux-i686-2.6/ctx.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c datafmt.c -o build/temp.linux-i686-2.6/datafmt.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c iodesc.c -o build/temp.linux-i686-2.6/iodesc.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c locale.c -o build/temp.linux-i686-2.6/locale.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c msgs.c -o build/temp.linux-i686-2.6/msgs.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c numeric.c -o build/temp.linux-i686-2.6/numeric.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c money.c -o build/temp.linux-i686-2.6/money.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c datetime.c -o build/temp.linux-i686-2.6/datetime.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c date.c -o build/temp.linux-i686-2.6/date.o > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_FREETDS=1 -I/opt/sybase/SYBSsa9/include -I/usr/include/python2.6 -c sybasect.c -o build/temp.linux-i686-2.6/sybasect.o > creating build/lib.linux-i686-2.6 > gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-i686-2.6/blk.o build/temp.linux-i686-2.6/databuf.o build/temp.linux-i686-2.6/cmd.o build/temp.linux-i686-2.6/conn.o build/temp.linux-i686-2.6/ctx.o build/temp.linux-i686-2.6/datafmt.o build/temp.linux-i686-2.6/iodesc.o build/temp.linux-i686-2.6/locale.o build/temp.linux-i686-2.6/msgs.o build/temp.linux-i686-2.6/numeric.o build/temp.linux-i686-2.6/money.o build/temp.linux-i686-2.6/datetime.o build/temp.linux-i686-2.6/date.o build/temp.linux-i686-2.6/sybasect.o -L/opt/sybase/SYBSsa9/lib -o build/lib.linux-i686-2.6/sybasect.so Or maybe it's Debian's fault for mixing stuff up into /usr/lib/pyshared etc.? -- Michał Sawicz <mi...@sa...> |
From: Robert B. <ro...@tr...> - 2011-01-25 23:46:59
|
MSSQL will let you set the TDS version you use when you connect. To my knowledge, when you have things set up correctly, you can connect to any version of Sybase. You may be using a TDS version that Sybase doesn't understand, if so you'd need to dumb it down to something lower. Regardless, if you're connecting to Sybase, you'll be better off with python-sybase. Now, what problem were you having connecting with it? > > when built without -DHAVE_FREETDS. It built and installed fine with > either of -DHAVE_FREETDS and -DHAVE_FREETDS=82 (I've freetds 0.82 from > Debian lenny), but then trying to import the Sybase module results in: > > >> > /usr/local/lib/python2.6/dist-packages/python_sybase-0.39-py2.6-linux-i686.egg/sybasect.so: undefined symbol: cs_config >> This symbol is defined by the ct library from Sybase, in your case you're replacing that with the freetds version. So, you may not have linked to freetds properly, or you may just need to add the directory where your freetds binaries are to LD_LIBRARY_PATH. Michał Sawicz wrote: > Dnia 2011-01-25, wto o godzinie 23:48 +0100, Michał Sawicz pisze: > >> And, as I wrote in the other e-mail, that's probably to be expected >> with pymssql trying to connect to (an old) sybase. >> > > I've confirmed that: > > >> 1> SET ARITHABORT ON; >> 2> go >> 1> SET CONCAT_NULL_YIELDS_NULL ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'CONCAT_NULL_YIELDS_NULL' on line 1 >> 1> SET ANSI_NULLS ON >> 2> go >> 1> SET ANSI_NULL_DFLT_ON ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_NULL_DFLT_ON' on line 1 >> 1> SET ANSI_PADDING ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_PADDING' on line 1 >> 1> SET ANSI_WARNINGS ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_WARNINGS' on line 1 >> 1> SET ANSI_NULL_DFLT_ON ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_NULL_DFLT_ON' on line 1 >> 1> SET CURSOR_CLOSE_ON_COMMIT ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'CURSOR_CLOSE_ON_COMMIT' on line 1 >> 1> SET QUOTED_IDENTIFIER ON; >> 2> go >> 1> SET IMPLICIT_TRANSACTIONS ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'IMPLICIT_TRANSACTIONS' on line 1 >> > > As you can see most of the SET commands from _mssql fail. So I'm left > with python-sybase for good... I could patch pymssql probably, but > I'd rather not. > > |
From: Michał S. <mi...@sa...> - 2011-01-25 23:20:39
|
Dnia 2011-01-25, wto o godzinie 23:48 +0100, Michał Sawicz pisze: > And, as I wrote in the other e-mail, that's probably to be expected > with pymssql trying to connect to (an old) sybase. I've confirmed that: > 1> SET ARITHABORT ON; > 2> go > 1> SET CONCAT_NULL_YIELDS_NULL ON; > 2> go > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'CONCAT_NULL_YIELDS_NULL' on line 1 > 1> SET ANSI_NULLS ON > 2> go > 1> SET ANSI_NULL_DFLT_ON ON; > 2> go > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'ANSI_NULL_DFLT_ON' on line 1 > 1> SET ANSI_PADDING ON; > 2> go > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'ANSI_PADDING' on line 1 > 1> SET ANSI_WARNINGS ON; > 2> go > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'ANSI_WARNINGS' on line 1 > 1> SET ANSI_NULL_DFLT_ON ON; > 2> go > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'ANSI_NULL_DFLT_ON' on line 1 > 1> SET CURSOR_CLOSE_ON_COMMIT ON; > 2> go > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'CURSOR_CLOSE_ON_COMMIT' on line 1 > 1> SET QUOTED_IDENTIFIER ON; > 2> go > 1> SET IMPLICIT_TRANSACTIONS ON; > 2> go > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'IMPLICIT_TRANSACTIONS' on line 1 As you can see most of the SET commands from _mssql fail. So I'm left with python-sybase for good... I could patch pymssql probably, but I'd rather not. -- Michał Sawicz <mi...@sa...> |
From: Michał S. <mi...@sa...> - 2011-01-25 22:50:59
|
Dnia 2011-01-25, wto o godzinie 16:35 -0600, Robert Boehne pisze: > Great! Let's focus on that. Below you're letting some of the > arguments default, like the password and database, but when you use > pymssql you have explicitly set them. > Can you still connect when you use those same arguments with the tsql > command line? It works like so: > $ tsql -S asademo -U DBA -P SQL > locale is "pl_PL.UTF-8" > locale charset is "UTF-8" > 1> But not with the database set: > $ tsql -S asademo -U DBA -P SQL -D asademo > locale is "pl_PL.UTF-8" > locale charset is "UTF-8" > Default database being set to asademo > Msg 102, Level 15, State 0, Server , Line 0 > ASA Error -131: Syntax error near 'use' on line 1 > There was a problem connecting to the server I suppose that's correct since AFAIK Sybase only has one database per server, so no database selection can take place. The exact same arguments to _mssql.connect(): > conn = _mssql.connect(server='asademo', user='DBA', password='SQL') > MssqlDriverException: Could not set connection properties And, as I wrote in the other e-mail, that's probably to be expected with pymssql trying to connect to (an old) sybase. Best regards, -- Michał Sawicz <mi...@sa...> |
From: Robert B. <ro...@tr...> - 2011-01-25 22:35:16
|
Michał Sawicz wrote: > Dnia 2011-01-25, wto o godzinie 15:49 -0600, Robert Boehne pisze: > >> Michał Sawicz wrote: >> >>> I also tried tsql itself, which seemed to connect (I got a 1> prompt) >>> but regardless of what query I tried to execute, I got no response, >>> dropping me to another prompt (2>). >>> >>> >> did you type "go" at the 2nd prompt and hit <Enter> ? >> > > Right, new to Sybase, thanks for that - it worked. > > Great! Let's focus on that. Below you're letting some of the arguments default, like the password and database, but when you use pymssql you have explicitly set them. Can you still connect when you use those same arguments with the tsql command line? >> tsql -S asademo -U DBA >> > > works. > > But in python, either of: > > >> conn = pymssql.connect(host='asademo', user='DBA', password='SQL', >> database='asademo') >> |
From: Michał S. <mi...@sa...> - 2011-01-25 22:29:32
|
Dnia 2011-01-25, wto o godzinie 23:00 +0100, Michał Sawicz pisze: > > InterfaceError: Could not set connection properties Looking at pymssql code [1] I can only assume that the module won't work for Sybase (at least for my version), simply because it seems not to support some of these properties. So I'm getting connected but the connection properties that pymssql is trying to set don't go through. So I need to have python-sybase working... [1] http://code.google.com/p/pymssql/source/browse/trunk/_mssql.pyx#482 Best regards, -- Michał Sawicz <mi...@sa...> |
From: Robert B. <ro...@tr...> - 2011-01-25 22:11:02
|
Michał Sawicz wrote: > Hi, I'm trying to get Python to work with a ASA 9.0.1 server and having > not much luck... > > Just to confirm the server's working and such, the following in Perl > works fine: > > DBI->connect('DBI:Sybase:server=asademo;database=asademo', 'DBA', > 'SQL'); > > First I tried python-mssql as it's supposed to work with Sybase, too, > but I couldn't get connected to the database at all, getting "Could not > set connection properties" errors when I was able to connect at last. > > I also tried tsql itself, which seemed to connect (I got a 1> prompt) > but regardless of what query I tried to execute, I got no response, > dropping me to another prompt (2>). > did you type "go" at the 2nd prompt and hit <Enter> ? > After some googling I found out that I should be using python-sybase. I > tried both 0.39 and 0.40pre1, yielding the same results: > > > >> ctx.c:242: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or >> ‘__attribute__’ before ‘clientmsg_cb’ >> ctx.c:287: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or >> ‘__attribute__’ before ‘servermsg_cb’ >> ctx.c: In function ‘CS_CONTEXT_ct_callback’: >> ctx.c:364: error: ‘clientmsg_cb’ undeclared (first use in this >> function) >> ctx.c:364: error: (Each undeclared identifier is reported only >> once >> ctx.c:364: error: for each function it appears in.) >> ctx.c:370: error: ‘servermsg_cb’ undeclared (first use in this >> function) >> error: command 'gcc' failed with exit status 1 >> > > when built without -DHAVE_FREETDS. It built and installed fine with > either of -DHAVE_FREETDS and -DHAVE_FREETDS=82 (I've freetds 0.82 from > Debian lenny), but then trying to import the Sybase module results in: > > >> /usr/local/lib/python2.6/dist-packages/python_sybase-0.39-py2.6-linux-i686.egg/sybasect.so: undefined symbol: cs_config >> > > And now I give up :/ > > Am I doing something wrong or do I simply have to drop that and go some > other route? > > Best regards, > It sounds like you're not specifying the right arguments to allow these pieces of software to connect to the server. Normally, you need a hostname, port, username and password. How you combine those to get a connection would depend on the specific software you're using. Post the details of how you create the connection - better yet - try and connect with explicit arguments, after you make sure you know what to set where. HTH, Robert |
From: Michał S. <mi...@sa...> - 2011-01-25 22:03:29
|
Dnia 2011-01-25, wto o godzinie 15:49 -0600, Robert Boehne pisze: > Michał Sawicz wrote: > > I also tried tsql itself, which seemed to connect (I got a 1> prompt) > > but regardless of what query I tried to execute, I got no response, > > dropping me to another prompt (2>). > > > did you type "go" at the 2nd prompt and hit <Enter> ? Right, new to Sybase, thanks for that - it worked. > It sounds like you're not specifying the right arguments to allow these > pieces of software to connect to the server. > Normally, you need a hostname, port, username and password. How you > combine those to get a connection would depend on the specific software > you're using. > > Post the details of how you create the connection - better yet - try and > connect with explicit arguments, after you make sure you know what to > set where. OK, so: > tsql -S asademo -U DBA works. But in python, either of: > conn = pymssql.connect(host='asademo', user='DBA', password='SQL', > database='asademo') > conn = pymssql.connect(host='asademo', user='DBA', password='SQL') result in: > --------------------------------------------------------------------------- > InterfaceError Traceback (most recent call last) > > /root/<ipython console> in <module>() > > /usr/lib/pymodules/python2.6/pymssql.pyc in connect(dsn, user, password, host, database, timeout, login_timeout, trusted, charset, as_dict, max_conn) > 607 raise OperationalError, e[0] > 608 except _mssql.MssqlDriverException, e: > --> 609 raise InterfaceError, e[0] > 610 > 611 # default query timeout > > > InterfaceError: Could not set connection properties Using dsn: > conn = pymssql.connect(dsn='asademo', user='DBA', password='SQL', > database='asademo') or > conn = pymssql.connect(dsn='asademo', user='DBA', password='SQL') both yield: > --------------------------------------------------------------------------- > InterfaceError Traceback (most recent call last) > > /root/<ipython console> in <module>() > > /usr/lib/pymodules/python2.6/pymssql.pyc in connect(dsn, user, password, host, database, timeout, login_timeout, trusted, charset, as_dict, max_conn) > 607 raise OperationalError, e[0] > 608 except _mssql.MssqlDriverException, e: > --> 609 raise InterfaceError, e[0] > 610 > 611 # default query timeout > > > InterfaceError: Connection to the database failed for an unknown reason. Hope that clears things up... BTW, here's a relevant part of my freetds.conf: > [asademo] > host = 127.0.0.1 > port = 2638 > tds version = 5.0 > dump file = /tmp/freetds.log > debug flags = 0xffff I can provide the freetds.log file, if it would help, of course. Thanks for the fast response, -- Michał Sawicz <mi...@sa...> |
From: Michał S. <mi...@sa...> - 2011-01-25 21:43:43
|
Hi, I'm trying to get Python to work with a ASA 9.0.1 server and having not much luck... Just to confirm the server's working and such, the following in Perl works fine: DBI->connect('DBI:Sybase:server=asademo;database=asademo', 'DBA', 'SQL'); First I tried python-mssql as it's supposed to work with Sybase, too, but I couldn't get connected to the database at all, getting "Could not set connection properties" errors when I was able to connect at last. I also tried tsql itself, which seemed to connect (I got a 1> prompt) but regardless of what query I tried to execute, I got no response, dropping me to another prompt (2>). After some googling I found out that I should be using python-sybase. I tried both 0.39 and 0.40pre1, yielding the same results: > ctx.c:242: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > ‘__attribute__’ before ‘clientmsg_cb’ > ctx.c:287: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > ‘__attribute__’ before ‘servermsg_cb’ > ctx.c: In function ‘CS_CONTEXT_ct_callback’: > ctx.c:364: error: ‘clientmsg_cb’ undeclared (first use in this > function) > ctx.c:364: error: (Each undeclared identifier is reported only > once > ctx.c:364: error: for each function it appears in.) > ctx.c:370: error: ‘servermsg_cb’ undeclared (first use in this > function) > error: command 'gcc' failed with exit status 1 when built without -DHAVE_FREETDS. It built and installed fine with either of -DHAVE_FREETDS and -DHAVE_FREETDS=82 (I've freetds 0.82 from Debian lenny), but then trying to import the Sybase module results in: > /usr/local/lib/python2.6/dist-packages/python_sybase-0.39-py2.6-linux-i686.egg/sybasect.so: undefined symbol: cs_config And now I give up :/ Am I doing something wrong or do I simply have to drop that and go some other route? Best regards, -- Michał Sawicz <mi...@sa...> |
From: Robert B. <ro...@tr...> - 2010-12-14 16:21:25
|
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.40pre1.tar.gz The module home page is here: http://python-sybase.sourceforge.net/ MAJOR CHANGES SINCE 0.39: Modify the DateTimeAsPython output conversion to return None when NULL is output support for Python without threads Ignore additional non-error codes from Sybase (1918 and 11932) Use outputmap in bulkcopy mode (thanks to patch by Cyrille Froehlich) Raise exception when opening a cursor on a closed connection Added unit tests Added new exception DeadLockError when Sybase is in a deadlock situation Add command properties CS_STICKY_BINDS and CS_HAVE_BINDS Added support for inputmap in bulkcopy reuse command and cursor when calling cursor.execute with same request Use ct_setparam to define ct_cursor parameters types instead of ct_param implicit conversion for CS_DATE_TYPE in CS_DATETIME_TYPE DataBuf Adding ct_cmd_props wrapper Increase DataBuf maxlength for params of a request when using CS_CHAR_TYPE params so that the buf can be reused BUGS CORRECTED SINCE 0.39: Corrected money type when using CS_MONEY4 (close bug 2615821) Corrected thread locking in ct_cmd_props (thanks to patch by Cyrille Froehlich) Corrected bug in type mapping in callproc (thanks to report by Skip Montanaro) Correct passing None in a DataBuf (thanks to patch by Bram Kuijvenhoven) The full ChangeLog is here: https://python-sybase.svn.sourceforge.net/svnroot/python-sybase/tags/r0_40pre1/ChangeLog |
From: Sébastien S. <sa...@us...> - 2010-12-08 17:06:56
|
Hi Robert, sorry for not replying earlier. It would be a good idea to make a new release based on trunk and I don't have time to do it, so since you volunteered I have added you as a developer so that you can do the release. Thank you for being volunteer and please don't mess up the release. I will be in another country with no internet connection for 1 month, back on the 6th of January. One thing I wanted to change for the next release is to remove the "ct_cursor mode" auto-detection when doing a select, and to make it customizable through a keyword argument to the Cursor.execute method, but I guess that will wait 0.41. regards -- Sébastien Sablé Le 03/12/2010 22:10, Robert Boehne a écrit : > Hello, I'm interested in having a release with some of the fixes since > 0.39. > I'm also willing to do the release myself if you can add me as a developer. > > Thanks, > > Robert Boehne |
From: Robert B. <ro...@tr...> - 2010-12-03 21:29:52
|
Hello, I'm interested in having a release with some of the fixes since 0.39. I'm also willing to do the release myself if you can add me as a developer. Thanks, Robert Boehne |
From: Andreas J. <li...@zo...> - 2010-05-10 07:49:33
|
I installed Python 2.4.6 + python-sybase 0.3.9 compiled against FreeTSD 0.8.2 on a standard Linux box. conn = connect(....) cursor = conn.cursor() cursor.execute('select "D_DID" from Dienstangaben') for row in cursor.fetchall(): print row fails badly: File "test.py", line 5, in ? cursor.execute('select "D_DID" from Dienstangaben') File "/root/python-sybase-0.39/lib/python2.4/site-packages/python_sybase-0.39-py2.4-linux-x86_64.egg/Sybase.py", line 546, in execute self._start() File "/root/python-sybase-0.39/lib/python2.4/site-packages/python_sybase-0.39-py2.4-linux-x86_64.egg/Sybase.py", line 695, in _start return self._mainloop() File "/root/python-sybase-0.39/lib/python2.4/site-packages/python_sybase-0.39-py2.4-linux-x86_64.egg/Sybase.py", line 728, in _mainloop self._row_result() File "/root/python-sybase-0.39/lib/python2.4/site-packages/python_sybase-0.39-py2.4-linux-x86_64.egg/Sybase.py", line 767, in _row_result count = self._fetch_rows(self._bufs, logical_result) File "/root/python-sybase-0.39/lib/python2.4/site-packages/python_sybase-0.39-py2.4-linux-x86_64.egg/Sybase.py", line 681, in _fetch_rows rows.append(_extract_row(bufs, 0, self.outputmap)) File "/root/python-sybase-0.39/lib/python2.4/site-packages/python_sybase-0.39-py2.4-linux-x86_64.egg/Sybase.py", line 289, in _extract_row row[col] = _column_value(buf[n], buf.datatype, outputmap) TypeError: unknown data format How to proceed? Andreas |
From: Sébastien S. <sa...@us...> - 2010-04-20 14:39:49
|
Hi Mic, great to hear about that SQLAlchemy will support Sybase. You should note that python-sybase is unfortunately not perfectly DBAPI compliant because of some limitations of sybase which make it hard to perfectly follow the specification (problems with nested requests notably). If you encounter such problem, and can reproduce it with a unitary test, I would be happy to help correct it in python-sybase. Also please note that the trunk has quite a lot of bug corrections compared to the last release, so I would suggest to use it rather than the latest official release (I should take some time to make a new release). The development of python-sybase is rather slow at the moment; I work on it for the needs of a legacy project at my work, but Sybase is not the priority at the moment and so I mostly do maintenance and small bug corrections. I didn't have time to make a proper release for a long time, though I hope to have more free time for that this summer. At some stage we will have to get the legacy project on which I work to support sybase in the latest version. When that will happen I will be able to dedicate a full month or 2 to improve python-sybase, mostly concerning performances (and unicode support). I should be able to also check Python 3 compatibility at the same time. But in the meantime, I can only ensure small bugs corrections and answering to emails. regards -- Sébastien Sablé Michael Bayer a écrit : > Hi there - > > I just wanted to give the developers a heads up that SQLAlchemy 0.6 will > feature a new Sybase ASE dialect that defaults to using Python-Sybase as > its backend. I finally got a test ASE server up over the weekend and > managed to get a rudimental Sybase conversation going on with this driver. > > Was also wondering about the development schedule of the driver, I see the > last release was in 2008. Are there any plans to add Python 3 support to > this driver ? When installing via Distribute, if the setup.py file > specifies a "2to3" flag then Distribute will automatically run the source > code through the 2to3 tool before installing. I've now created Python 3 > versions of three different libraries (Mako, Beaker, SQLAlchemy) in this > way and its pretty straightforward. > > thanks for your efforts on this driver ! > > - mike > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Python-sybase-misc mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-sybase-misc > |
From: Michael B. <mi...@zz...> - 2010-03-15 15:05:50
|
Hi there - I just wanted to give the developers a heads up that SQLAlchemy 0.6 will feature a new Sybase ASE dialect that defaults to using Python-Sybase as its backend. I finally got a test ASE server up over the weekend and managed to get a rudimental Sybase conversation going on with this driver. Was also wondering about the development schedule of the driver, I see the last release was in 2008. Are there any plans to add Python 3 support to this driver ? When installing via Distribute, if the setup.py file specifies a "2to3" flag then Distribute will automatically run the source code through the 2to3 tool before installing. I've now created Python 3 versions of three different libraries (Mako, Beaker, SQLAlchemy) in this way and its pretty straightforward. thanks for your efforts on this driver ! - mike |
From: <sk...@po...> - 2009-10-28 16:12:58
|
I routinely use c.execute() to execute SELECT, INSERT, etc and occasionally use c.callproc() to call stored procedures. I have never used DECLARE before however. How does that fit into c.execute() or c.callproc() calls? I didn't see any use in the examples or doc directories. Can that just get stuffed into the string passed to execute() or callproc()? Thanks, -- Skip Montanaro - sk...@po... - http://www.smontanaro.net/ |
From: Sébastien S. <sa...@us...> - 2009-10-22 16:53:18
|
Hi Andrei, I think you are right it would be more consistent to also prefer the mono-threaded libraries on 64 bits architectures. I will make the modification you suggested. On the other hand, it would be even better if we could specify with a compilation flag to setup.py the preferred way to compile: static/dynamic - threaded/non-threaded. I will try to see if such options can be added, with a lower priority. regards -- Sébastien Sablé Gnepp, Andrei a écrit : > Hi, > > In revision 405, setup.py was changed to default to the non-thread-safe > Sybase libraries under 32-bit compilation. However, 64-bit compilation > still defaults to the thread-safe ones (with "_r" in the name). > > 91 extensions = [('', 'a'), ('', 'so'), ('_r', 'a'), ('_r', > 'so')] > > 92 if have64bit and sys.platform not in ['osf1V5']: > > 93 extensions = [('_r64', 'a'), ('_r64', 'so')] + extensions > > Is this discrepancy between 32- and 64-bit intentional, or can 64-bit > compilation also default to the non-thread-safe libraries when available? > > i.e. something like: > > 93 extensions = [('64', 'a'), ('64', 'so'), ('_r64', > 'a'), ('_r64', 'so')] + extensions > > Andrei Gnepp > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > > > ------------------------------------------------------------------------ > > _______________________________________________ > Python-sybase-misc mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-sybase-misc |
From: Gnepp, A. <And...@de...> - 2009-10-21 16:58:19
|
Hi, In revision 405, setup.py was changed to default to the non-thread-safe Sybase libraries under 32-bit compilation. However, 64-bit compilation still defaults to the thread-safe ones (with "_r" in the name). 91 extensions = [('', 'a'), ('', 'so'), ('_r', 'a'), ('_r', 'so')] 92 if have64bit and sys.platform not in ['osf1V5']: 93 extensions = [('_r64', 'a'), ('_r64', 'so')] + extensions Is this discrepancy between 32- and 64-bit intentional, or can 64-bit compilation also default to the non-thread-safe libraries when available? i.e. something like: 93 extensions = [('64', 'a'), ('64', 'so'), ('_r64', 'a'), ('_r64', 'so')] + extensions Andrei Gnepp |
From: Jeffrey Z. <Jef...@q-...> - 2009-10-01 13:42:25
|
When I execute a simple SELECT statement that includes columns of type UNIVARCHAR, python-sybase throws a TypeError exception as shown here: Traceback (most recent call last): File "/home/jeffreyz/workspace-3.5/sybase-tests/src/connection_tests.py", line 61, in <module> cursor.execute("SELECT AccountTypeID, Description FROM AccountType") File "build/bdist.linux-i686/egg/Sybase.py", line 554, in execute File "build/bdist.linux-i686/egg/Sybase.py", line 703, in _start File "build/bdist.linux-i686/egg/Sybase.py", line 736, in _mainloop File "build/bdist.linux-i686/egg/Sybase.py", line 775, in _row_result File "build/bdist.linux-i686/egg/Sybase.py", line 689, in _fetch_rows File "build/bdist.linux-i686/egg/Sybase.py", line 292, in _extract_row TypeError: unknown data format In this example, the column "Description" is of type UNIVARCHAR(50). Is this a known problem and is there a fix? I compiled python-sybase on Ubuntu Linux with the ASE 15.02 Express Edition for Linux. Has anyone else tried to select Unicode columns with any success? Regards, Jeffrey |
From: VV W <vv...@gm...> - 2009-09-11 16:31:48
|
Thanks Lloyd for your reply. dsn is "None" by default so we can omit it without any problems. For "host", if I use host = "somehost.COM", then my code gets the same error as I posted last time. Now I use host="12.12.12.12:5000", (5000 is a port number), then I get File "/var/lib/python-support/python2.5/pymssql.py", line 328, in connect con = _mssql.connect(dbhost, dbuser, dbpasswd) _mssql.error: Could not set connection properties Did you install a python/sybase library module specially? On Fri, Sep 11, 2009 at 5:39 AM, Lloyd Kvam <py...@ve...> wrote: > On Thu, 2009-09-10 at 13:21 -0700, VV W wrote: > > Hello, > > > > I modified my script and tested again with > > > > con=pymssql.connect(dsn='sybase-sever.mycompany.com', user='sa', > > password='',host="12.12.12.12",database='db-name') > > self.conn = pymssql.connect( > host = "somehost.COM", > user='someuser', > password='somepassword', > database='somedb', > ) > > Works for me. I don't know how to use the dsn parameter. Does that > depend on ODBC configuration? > > > > > and now I got > > > > > > File "/var/lib/python-support/python2.5/pymssql.py", line 328, in > > connect > > con = _mssql.connect(dbhost, dbuser, dbpasswd) > > _mssql.error: DB-Lib error message 20009, severity 9: > > Unable to connect: Adaptive Server is unavailable or does not exist > > Net-Lib error during Operation now in progress > > Error 115 - Operation now in progress > > > > > > this is the problem that I got yesterday. It's really frustrating. > > > > Anybody can give me a clue? > > > > Thanks so much. > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > > trial. Simplify your report design, integration and deployment - and > focus on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > _______________________________________________ Python-sybase-misc > mailing list Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-sybase-misc > -- > Lloyd Kvam > Venix Corp > DLSLUG/GNHLUG library > http://dlslug.org/library.html > http://www.librarything.com/catalog/dlslug > http://www.librarything.com/rsshtml/recent/dlslug > http://www.librarything.com/rss/recent/dlslug > > |
From: Lloyd K. <py...@ve...> - 2009-09-11 14:22:53
|
On Thu, 2009-09-10 at 13:21 -0700, VV W wrote: > Hello, > > I modified my script and tested again with > > con=pymssql.connect(dsn='sybase-sever.mycompany.com', user='sa', > password='',host="12.12.12.12",database='db-name') self.conn = pymssql.connect( host = "somehost.COM", user='someuser', password='somepassword', database='somedb', ) Works for me. I don't know how to use the dsn parameter. Does that depend on ODBC configuration? > > and now I got > > > File "/var/lib/python-support/python2.5/pymssql.py", line 328, in > connect > con = _mssql.connect(dbhost, dbuser, dbpasswd) > _mssql.error: DB-Lib error message 20009, severity 9: > Unable to connect: Adaptive Server is unavailable or does not exist > Net-Lib error during Operation now in progress > Error 115 - Operation now in progress > > > this is the problem that I got yesterday. It's really frustrating. > > Anybody can give me a clue? > > Thanks so much. > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ Python-sybase-misc mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/python-sybase-misc -- Lloyd Kvam Venix Corp DLSLUG/GNHLUG library http://dlslug.org/library.html http://www.librarything.com/catalog/dlslug http://www.librarything.com/rsshtml/recent/dlslug http://www.librarything.com/rss/recent/dlslug |