[DB-SIG] Accessing MSSQL from Python

Marcos Sánchez Provencio msanchez@grupoburke.com
Wed, 28 Aug 2002 15:03:14 +0200 (CEST)


Oops, I built freeTDS alright, but I get this when building Sybase. i have to
leave now, but I will look into it tomorrow. Any quick pointers?

Hasta mañana...

running install
running build
running build_py
not copying Sybase.py (output up-to-date)
running build_ext
building 'sybasect' extension
skipping blk.c (build/temp.linux-i686-2.1/blk.o up-to-date)
gcc -g -O2 -Wall -Wstrict-prototypes -fPIC -DWANT_BULKCOPY -
I/home/atheneos/local/freetds/include -
I/home/atheneos/python21/include/python2.1 -c databuf.c -o build/temp.linux-
i686-2.1/databuf.o
In file included from /home/atheneos/local/freetds/include/cspublic.h:24,
                 from /home/atheneos/local/freetds/include/ctpublic.h:24,
                 from sybasect.h:27,
                 from databuf.c:26:
/home/atheneos/local/freetds/include/tds.h:640: warning: function declaration
isn't a prototype
/home/atheneos/local/freetds/include/tds.h:644: warning: function declaration
isn't a prototype
/home/atheneos/local/freetds/include/tds.h:647: warning: function declaration
isn't a prototype
/home/atheneos/local/freetds/include/tds.h:651: warning: function declaration
isn't a prototype
databuf.c: In function `databuf_alloc':
databuf.c:87: `CS_SRC_VALUE' undeclared (first use in this function)
databuf.c:87: (Each undeclared identifier is reported only once
databuf.c:87: for each function it appears in.)
databuf.c: In function `DataBuf_item':
databuf.c:181: `CS_BIT' undeclared (first use in this function)
databuf.c:181: parse error before `)'
databuf.c: In function `DataBuf_ass_item':
databuf.c:292: `CS_BIT' undeclared (first use in this function)
databuf.c:292: parse error before `)'
error: command 'gcc' failed with exit status 1


> On Wed, 28 Aug 2002, Marcos Sánchez Provencio wrote:
>> Thank you very much, that would be perfect for me. So, all I need is:
>>
>> freeTDS
>> Sybase module
>
> Make sure you get the current CVS version of FreeTDS.  The last release
> is useless.
>
>> Do i need any proprietary sw? What were the changes that you had to
>> make? Any gotchas?
>
> That all.  There is only one important change I needed to make:
>
> diff -ur sybase-0.35pre1/Sybase.py sybase-kbj/Sybase.py
> --- sybase-0.35pre1/Sybase.py   Sun Apr 21 02:00:03 2002
> +++ sybase-kbj/Sybase.py        Tue Jul  9 17:49:41 2002
> @@ -136,7 +136,7 @@
>     raise DatabaseError(_fmt_client(msg))
>
> def _servermsg_cb(ctx, conn, msg):
> -    if msg.msgnumber not in (5701,):
> +    if msg.msgnumber not in (5701,5703):
>         raise DatabaseError(_fmt_server(msg))
>
> def _row_bind(cmd, count = 1):
>
> I have a few more patches that I am still testing that fix some locking
> issues with the Python driver.  Let me know if you run into those and I
> can send them too.
>
> Good luck,
> -Kevin
>
>>
>> TIA
>>
>> > On Wed, 28 Aug 2002, Marcos Sánchez Provencio wrote:
>> >> Is there some portable way (I mean non-MS) to access MSSQL from
>> >> Python? FreeTDS has a Python page which is absolutely blank.
>> >
>> > I was able to compile David Cole's Sybase module (with very few
>> > changes) with FreeTDS using the TDS version 7 protocol.  I was then
>> > able to connect to a MSSQL 2000 server and run queries very
>> > reliably.
>> >
>> > -Kevin
>> >
>> > --
>> > Kevin Jacobs
>> > The OPAL Group - Enterprise Systems Architect
>> > Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
>> > Fax:
>> >   (216) 986-0714              WWW:    http://www.theopalgroup.com
>> >
>> >
>> > _______________________________________________
>> > DB-SIG maillist  -  DB-SIG@python.org
>> > http://mail.python.org/mailman/listinfo/db-sig
>>
>>
>>
>
> --
> --
> Kevin Jacobs
> The OPAL Group - Enterprise Systems Architect
> Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com Fax:
>   (216) 986-0714              WWW:    http://www.theopalgroup.com