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: David <da...@ne...> - 2004-09-10 16:25:27
|
To build python-sybase on Mac OS X 10.3: 1. Install all three kits from the Sybase-provided dmg 2. Set your SYBASE environment variable 3. 'python setup.py build' ... this will compile all the files, but you will blow up at link time on a pile of undefined symbols 4. Copy the gcc command that blew up to the clipboard and re-paste it to your command line. Navigate to right before '-framework Python' and add '-framework SybaseOpenClient -framework CoreFoundation'. Then press return to re-run the link operation. 5. 'python setup.py install' and you should be in working order. Run the examples to test. |
From: Alex S. <ale...@gm...> - 2004-09-10 08:47:15
|
On Fri, 3 Sep 2004 14:04:50 -0500, Josh Close <na...@gm...> wrote: > I'd like to know this too, I've run into the same problems. Me too. I've been doing the same thing as Skip, not really satisfying. cheers, Alex -- Alex Suzuki | as...@cy... | http://n.ethz.ch/student/asuzuki/ "Computer Science is no more about computers than astronomy is about telescopes." - E.W.Dijkstra |
From: Joshua Moore-O. <jo...@ch...> - 2004-09-08 16:44:09
|
There is a textsize setting to retreive large text fields.. If I set this higher than 65536 (using SET TEXTSIZE X; ) and the field data is more than that many characters, Sybase will raise the error Traceback (most recent call last): File "sytest.py", line 16, in ? xData = cur.fetchall() File "/usr/lib/python2.3/site-packages/Sybase.py", line 733, in fetchall return self._fetcher.fetchall() File "/usr/lib/python2.3/site-packages/Sybase.py", line 517, in fetchall row = self.fetchone() File "/usr/lib/python2.3/site-packages/Sybase.py", line 456, in fetchone _fetch_rows(self._cmd, self._bufs, self._array) File "/usr/lib/python2.3/site-packages/Sybase.py", line 217, in _fetch_rows raise Error('ct_fetch') Sybase.Error: ct_fetch Since this happens only at >65536 textsize, this must be some kind of buffer problem? I am using Gentoo with kernel 2.6 python 2.3.3 freetds 0.62.3 Any insight is very appreciated. Joshua Moore-Oliva. |
From: David L. <dla...@la...> - 2004-09-07 04:29:44
|
I am new to this module, so please excuse the naive question. I have the follwing test program on a Fedora Core 2 Linux system: import Sybase db = Sybase.connect("TRAX", "etraxsales_user", "RxF39pqm") print "db connect done" c = db.cursor() c.execute("select * from traffic_counter where traffic_count = 200") print "Query done" print c.fetchone() Running the above test produses the following results (Note that I have inserted some debug print statement in the Sybase.py module). The user name and password are valid as the database is only for test purposes. Any help would be appreciated. Regards, David Lambert. [dlambert@security pySybase]$ python testSybase.py Entering Sybase module db connect done Trying to open connection Successfully opened connection cmd = <CommandType object at 0xf6ffa800> sql = select * from traffic_counter where traffic_count = 200 params.items() = [] Successful end of cursor execute Query done In cursor fetchone() just before _fetcher.fetchone(). _fetcher = <Sybase._FetchLazy instance at 0xf6ffa78c> In _FetchLazy.fetchone(). State = 1 Length of array = 0 Array_pos = 0 Before _fetch_rows After _fetch_rows Segmentation fault |
From: David L. <dla...@la...> - 2004-09-06 20:13:28
|
I am new to this module, so please excuse the naive question. I have the follwing test program on a Fedora Core 2 Linux system: import Sybase db = Sybase.connect("TRAX", "etraxsales_user", "RxF39pqm") print "db connect done" c = db.cursor() c.execute("select * from traffic_counter where traffic_count = 200") print "Query done" print c.fetchone() Running the above test produses the following results (Note that I have inserted some debug print statement in the Sybase.py module). The user name and password are valid as the database is only for test purposes. Any help would be appreciated. [dlambert@security pySybase]$ python testSybase.py Entering Sybase module db connect done Trying to open connection Successfully opened connection cmd = <CommandType object at 0xf6ffa800> sql = select * from traffic_counter where traffic_count = 200 params.items() = [] Successful end of cursor execute Query done In cursor fetchone() just before _fetcher.fetchone(). _fetcher = <Sybase._FetchLazy instance at 0xf6ffa78c> In _FetchLazy.fetchone(). State = 1 Length of array = 0 Array_pos = 0 Before _fetch_rows After _fetch_rows Segmentation fault |
From: Josh C. <na...@gm...> - 2004-09-04 12:04:55
|
I'd like to know this too, I've run into the same problems. -Josh On Fri, 3 Sep 2004 13:45:07 -0500, Skip Montanaro <sk...@po...> 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. > > Is there a better (less sledgehammer-like) way to recover from errors? > > Thanks, > > -- > Skip Montanaro > Got spam? http://www.spambayes.org/ > sk...@po... > _______________________________________________ > Python-sybase mailing list > Pyt...@ww... > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase > |
From: Skip M. <sk...@po...> - 2004-09-04 11:45:19
|
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. Is there a better (less sledgehammer-like) way to recover from errors? Thanks, -- Skip Montanaro Got spam? http://www.spambayes.org/ sk...@po... |
From: Josh C. <na...@gm...> - 2004-09-02 07:10:34
|
It looks like the email server uses a db to store it's users/hosts/domains/etc, and it can't access it "Error: Access denied for user...". This would allow for someone to send out but have errors trying to recieve to the server 'cause it can't lookup the info it needs. -Josh On Wed, 1 Sep 2004 14:56:11 +0200, JZ <cy.fbp.eryvtvne@ncbybtrglxn.pbz> wro= te: > Wed, 01 Sep 2004 08:33:51 -0400, na comp.lang.python, Peter Hansen > napisa=C5=82(a): >=20 > > The first three characters are the critical part. If they aren't > > a three-digit SMTP response code, your server is likely borken. > > If you post the results, someone might have some advice, but it's > > not likely this is a Python issue. >=20 > via telnet localhost 25: > ... > Connected to localhost. > Escape character is '^]'. > db_connect: failed to connect to database: Error: Access denied for user: > 'admin@localhost' (Using password: YES) > 220 NS1.4U2.PL ESMTP >=20 > Strange, because I can send emails from bash using mail command. I can se= nd > email with php scripts as well (using mail() function). php.ini file has > empty settings for SMTP, so it uses default system settings... >=20 > -- > JZ >=20 >=20 >=20 > -- > http://mail.python.org/mailman/listinfo/python-list > |
From: Vadim B. <bv...@pr...> - 2004-09-02 07:04:25
|
Hi! I have a small problem with Sybase-0.36 module on Windows. import Sybase db=3DSybase.connect('someserver','someuser','somepass') and get "the instruction at 0x009dd8a7 referenced memory at (0x00000001) the memory could not be written" Problem found in file ctx.c on declarations: static CS_RETCODE clientmsg_cb(CS_CONTEXT *cs_ctx, CS_CONNECTION *cs_conn, CS_CLIENTMSG *cs_msg) and static CS_RETCODE servermsg_cb(CS_CONTEXT *cs_ctx, CS_CONNECTION *cs_conn, CS_SERVERMSG *cs_msg) I change to (note - CS_INTERNAL): static CS_RETCODE CS_INTERNAL clientmsg_cb(CS_CONTEXT *cs_ctx, CS_CONNECTION *cs_conn, CS_CLIENTMSG *cs_msg) and static CS_RETCODE CS_INTERNAL servermsg_cb(CS_CONTEXT *cs_ctx, CS_CONNECTION *cs_conn, CS_SERVERMSG *cs_msg) This changes declaration of functions to __stdcall on Windows (default is __ccall). -- Vadim Beloborodov |
From: Andrew M. <an...@ob...> - 2004-08-19 17:35:55
|
>I have a user with a long-running process that does little more than make >lots of Sybase queries. It's memory footprint is slowly growing in size. I >can't yet attribute it to anything else in the program (no gc.garbage, no >other third-party modules in use, etc), so I thought I'd check to see if >there are any known memory leaks in 0.36. Nothing popped up in a google >query. I've found that to be a fairly common problem in most long-running python applications. In my apps, my suspician is fragmentation, rather than a leak. To be fair, any long running app in any language that allocates and frees random sized objects has this problem unless it takes steps to avoid it (or uses an allocator that has strategies for avoiding it). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Skip M. <sk...@po...> - 2004-08-19 09:41:06
|
I have a user with a long-running process that does little more than make lots of Sybase queries. It's memory footprint is slowly growing in size. I can't yet attribute it to anything else in the program (no gc.garbage, no other third-party modules in use, etc), so I thought I'd check to see if there are any known memory leaks in 0.36. Nothing popped up in a google query. Thx, -- Skip Montanaro Got spam? http://www.spambayes.org/ sk...@po... |
From: Josh C. <na...@gm...> - 2004-08-18 08:22:10
|
I have found that when running queries that they are usually cancelled the first time it's ran, then the next it works fine. It's being cancelled internally in Sybase somewhere. Is there a way to tell if the query has been cancelled? Like a return code or something? What would cause Sybase to issue a cancel on a query? -Josh |
From: Josh C. <na...@gm...> - 2004-08-13 06:30:04
|
Does anyone have a clue what's going on here??? -Josh On Wed, 4 Aug 2004 11:41:18 -0500, Josh Close <na...@gm...> wrote: > I got a log from the sybase module and it is being cancelled by sybase..... > > ct_con_alloc(ctx0, &conn) -> CS_SUCCEED, conn0 > ct_con_props(conn0, CS_SET, CS_USERNAME, "myUser", CS_NULLTERM, NULL) > -> CS_SUCCEED > ct_con_props(conn0, CS_SET, CS_PASSWORD, "myPass", CS_NULLTERM, NULL) > -> CS_SUCCEED > servermsg_cb > servermsg_cb > ct_connect(conn0, "myServer", CS_NULLTERM) -> CS_SUCCEED > ct_options(conn0, CS_SET, CS_OPT_CHAINXACTS, 1, CS_UNUSED, NULL) -> CS_SUCCEED > ct_cmd_alloc(conn0, &cmd) -> CS_SUCCEED, cmd0 > ct_command(cmd0, CS_LANG_CMD, "use myDatabase", CS_NULLTERM, > CS_UNUSED) -> CS_SUCCEED > ct_send(cmd0) -> CS_SUCCEED > servermsg_cb > ct_results(cmd0, &result) -> CS_SUCCEED, CS_CMD_SUCCEED > ct_results(cmd0, &result) -> CS_SUCCEED, CS_CMD_DONE > ct_results(cmd0, &result) -> CS_END_RESULTS, CS_FALSE > ct_cmd_drop(cmd0) -> CS_SUCCEED > Cursor.execute > _lock: count -> 1 > ct_cmd_alloc(conn0, &cmd) -> CS_SUCCEED, cmd1 > _lock: count -> 2 > _set_state: _LAZY_IDLE > _unlock: count -> 1 > ct_command(cmd1, CS_LANG_CMD, "query goes here; ", CS_NULLTERM, > CS_UNUSED) -> CS_SUCCEED > ct_send(cmd1) -> CS_SUCCEED > _start_results > ct_results(cmd1, &result) -> CS_SUCCEED, CS_STATUS_RESULT > ct_res_info(cmd1, CS_NUMDATA, &value, CS_UNUSED, NULL) -> CS_SUCCEED, 1 > ct_describe(cmd1, 1, &fmt) -> CS_SUCCEED, datafmt0=[name:"" > type:CS_INT_TYPE status:CS_FALSE format:CS_FMT_UNUSED count:1 > maxlength:4 scale:0 precision:0] > ct_bind(cmd1, 1, &datafmt0->fmt=[name:"" type:CS_INT_TYPE > status:CS_FALSE format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 > precision:0], databuf0->buff, databuf0->copied, databuf0->indicator) > -> CS_SUCCEED, databuf0 > _set_state: _LAZY_FETCHING > ct_cancel(conn0, NULL, CS_CANCEL_ALL) -> CS_SUCCEED > _unlock: count -> 0 > 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_OPT_STATS_IO) -> CS_SUCCEED > ct_con_drop(conn0) -> CS_SUCCEED > > Why would this happen? I'd really not like to have to requery every > time that happens. > > -Josh > > > > > On Wed, 4 Aug 2004 09:38:23 -0500, Josh Close <na...@gm...> wrote: > > I am using sybase with mssql and freetds. When I execute a query I > > will get 0 results most of the time when first ran. I will run it > > again 1 second later and it will work just fine. > > > > Could this be a sybase error? Or possibly a freetds error? > > > > I did 'export TDSDUMP=/var/log/freetds.log' to see what freetds was > > doing and got this > > > > 09:30:53.204554 tds_process_end: more_results = 0 > > was_cancelled = 1 > > error = 0 > > done_count_valid = 0 > > 09:30:53.204584 tds_process_end() state set to TDS_IDLE > > 09:30:53.204852 ct_cmd_drop() > > 09:30:53.204909 ct_con_props() action = CS_GET property = 26 > > 09:30:53.204939 ct_close() > > 09:30:53.205109 ct_con_drop() > > > > Does that mean that tds was cancelled at some point by sybase? > > > > Any help would be great. > > > > -Josh > > > |
From: John J L. <jj...@po...> - 2004-08-12 13:53:50
|
On Wed, 11 Aug 2004, Charles Bearden wrote: [...] > I don't know what web server you are running or which version, but in a > previous job, when I routinely built the latest Apache 1.3 with some > bells and whistles, I recall there being some issues caused by mm shared > memory lib support being compiled in. I was using mod_perl and mod_php [...] mm = memory mapped? AFAIK, the server in question wasn't built for that, but it's an idea. Thanks. > One tip: 'os.environ' is a dictionary of environment variables for the > current script. You can use this dictionary to initialize your script > to precisely the same environment your interactive shell enjoys, e.g.: [...] Sure. I did that first. The shell script wrapper was simply paranoia and/or superstition ;-) John |
From: Charles B. <Cha...@ut...> - 2004-08-12 09:25:08
|
> > I *am* setting LD_LIBRARY_PATH (using a shell script wrapper around a > > Python CGI script), but I guess it's non-Sybase libs that are not being > > found. > [...] >=20 > LD_LIBRARY_PATH is identical in both shell and CGI script environment. > Same goes for SYBASE and SYBASE_OCS. >=20 > None of the other environment variables seem even vaguely relevant. I > didn't have time in my most recent visit to slavishly copy the whole > environment, but I'm doubting again that that's my problem... >=20 > Still, you may well be right that this is a linking problem. >=20 > Any other ideas?? I don't know what web server you are running or which version, but in a previous job, when I routinely built the latest Apache 1.3 with some bells and whistles, I recall there being some issues caused by mm shared memory lib support being compiled in. I was using mod_perl and mod_php at the time, and not mod_python. May not be relevant, since one problem I recall led to the server not even starting. One tip: 'os.environ' is a dictionary of environment variables for the current script. You can use this dictionary to initialize your script to precisely the same environment your interactive shell enjoys, e.g.: --------------------------------------------------------- import os #-- Insert new path at front of LD_LIBRARY_PATH env var os.environ['LD_LIBRARY_PATH'] =3D '/usr/local/freetds/lib:%s' % (os.environ['LD_LIBRARY_PATH']) #-- Initialize SYBASE env var os.environ['SYBASE'] =3D '/usr/local/freetds' #-- etc. etc. etc. --------------------------------------------------------- This might prevent a slip between the shell and the script ;-) HTH, Chuck Bearden Systems Analyst III School of Health Information Sciences University of Texas at Houston 713.500.3954 (voice) 713.500.3907 (fax) Cha...@ut... |
From: John J L. <jj...@po...> - 2004-08-12 08:42:33
|
On Sat, 31 Jul 2004, John J Lee wrote: > On Sat, 31 Jul 2004, Gregory Bond wrote: > > > > I can import Sybase from a Solaris shell prompt fine. > > > > > > When I try importing Sybase from code run from a CGI script, though, it > > > fails at the first cs_ctx_alloc() in Sybase.py, and I get the following in > > > the debug file: > > > > That'll be LD_LIBRARY_PATH issues. When you do a connect, the sybase > > libs dynamically link other libraries, giving these wierd errors if it > > fails. There's no way (afaict) of futzing -R flags at compile time > > for this, you just gotta have the right LD_LIBRARY_PATH (or symlink > > the offenders into /usr/local/lib or whatever.) > > > > Seems to be a problem with 12.0/12.5 more than 11.0 libraries. > > Thank you! OK, I take it back ;-) > I've been bashing my head against this for some time now. > > I *am* setting LD_LIBRARY_PATH (using a shell script wrapper around a > Python CGI script), but I guess it's non-Sybase libs that are not being > found. [...] LD_LIBRARY_PATH is identical in both shell and CGI script environment. Same goes for SYBASE and SYBASE_OCS. None of the other environment variables seem even vaguely relevant. I didn't have time in my most recent visit to slavishly copy the whole environment, but I'm doubting again that that's my problem... Still, you may well be right that this is a linking problem. Any other ideas?? John |
From: Marcos P. <msa...@gr...> - 2004-08-11 01:47:02
|
Is it possible to tell errors form warnings when working with SQL Server? There are some warnings (eg null value eliminated from aggregate) that I want to ignore. This could be based on the severity level of the message. Something like: def _servermsg_cb(ctx, conn, msg): #if msg.msgnumber not in (5701, 5703): if msg.severity: raise DatabaseError(_fmt_server(msg)) If not, it is not possible to execute 'sp_help mytable' on a table that has no views. It is funny that the program never ends, it hangs. |
From: Charles B. <Cha...@ut...> - 2004-08-06 12:21:27
|
Here's the script that generated the traceback I gave in the previous message: --------------------------------------------------------------------- import sys, os if not os.environ.get('SYBASE'): os.environ['SYBASE'] =3D '/usr/local/freetds' if not os.environ.get('ODBCINI'): os.environ['ODBCINI'] =3D '/usr/local/etc/odbc.ini' import Sybase from pyPgSQL import PgSQL s =3D 'DBServer' u =3D 'DOMAIN\jrandomuser' p =3D 'securepwd' d =3D 'DBName' c_pg =3D PgSQL.connect(database=3Dd) cu_pg =3D c_pg.cursor() c_sy =3D Sybase.connect(s, u, p, d) cu_sy =3D c_sy.cursor() cu_pg.execute('select pmid, xmldata from pmxml limit 10') while True: r =3D cu_pg.fetchone() if not r: break dct =3D { '@pmid' : r[0] , '@xmldata' : r[1] } cu_sy.execute('delete from fooflap') s =3D ''' INSERT INTO testTable (PMID, XmlData) VALUES (@pmid, @xmldata) ''' cu_sy.execute('declare @pmid nvarchar(10), @xmldata ntext') cu_sy.execute(s, dct) c_pg.close() c_sy.close() --------------------------------------------------------------------- Thanks, Chuck |
From: Charles B. <Cha...@ut...> - 2004-08-06 12:05:27
|
I resolved the problem I posted about yesterday--I had incorrectly the SYBASE environment variable and made one crucial misspelling. Mea culpa. Mea stupida culpa. So now I'd like to copy some data from PostgreSQL tables to MS SQL tables. I've just discovered that I need to declare the variables that are used in the MS SQL statement as placeholders. One of the columns in the destination table is type ntext, but when I try to declare a variable of type ntext, an exception is raised (originating with SQL Server, I'm sure) to this effect: Traceback (most recent call last): File "./sybase_test.py", line 33, in ? cu_sy.execute('declare @pmid nvarchar(10), @xmldata ntext') File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 687, in execute self.description =3D fetcher.start(self.arraysize) File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 442, in start return self._start_results() File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 546, in _start_r esults status, result =3D self._cmd.ct_results() File "/usr/local/lib/python2.3/site-packages/Sybase.py", line 161, in _serverm sg_cb raise DatabaseError(_fmt_server(msg)) Sybase.DatabaseError: Msg 2739, Level 16, State 1, Line 1 The text, ntext, and image data types are invalid for local variables. As you can infer, '@xmldata' is meant to hold an XML record, which in this application is likely to be larger than the varchar upper limit of 8000 bytes. Is there a way to use the Sybase (0.36) module + FreeTDS (0.62.4) to toss large chunks of data back and forth between a Linux client and an MS SQL Server? Am I missing something obvious? Thanks for your help, Chuck Chuck Bearden Systems Analyst III School of Health Information Sciences University of Texas at Houston 713.500.3954 (voice) 713.500.3907 (fax) Cha...@ut... |
From: Josh C. <na...@gm...> - 2004-08-05 09:41:21
|
I got a log from the sybase module and it is being cancelled by sybase..... ct_con_alloc(ctx0, &conn) -> CS_SUCCEED, conn0 ct_con_props(conn0, CS_SET, CS_USERNAME, "myUser", CS_NULLTERM, NULL) -> CS_SUCCEED ct_con_props(conn0, CS_SET, CS_PASSWORD, "myPass", CS_NULLTERM, NULL) -> CS_SUCCEED servermsg_cb servermsg_cb ct_connect(conn0, "myServer", CS_NULLTERM) -> CS_SUCCEED ct_options(conn0, CS_SET, CS_OPT_CHAINXACTS, 1, CS_UNUSED, NULL) -> CS_SUCCEED ct_cmd_alloc(conn0, &cmd) -> CS_SUCCEED, cmd0 ct_command(cmd0, CS_LANG_CMD, "use myDatabase", CS_NULLTERM, CS_UNUSED) -> CS_SUCCEED ct_send(cmd0) -> CS_SUCCEED servermsg_cb ct_results(cmd0, &result) -> CS_SUCCEED, CS_CMD_SUCCEED ct_results(cmd0, &result) -> CS_SUCCEED, CS_CMD_DONE ct_results(cmd0, &result) -> CS_END_RESULTS, CS_FALSE ct_cmd_drop(cmd0) -> CS_SUCCEED Cursor.execute _lock: count -> 1 ct_cmd_alloc(conn0, &cmd) -> CS_SUCCEED, cmd1 _lock: count -> 2 _set_state: _LAZY_IDLE _unlock: count -> 1 ct_command(cmd1, CS_LANG_CMD, "query goes here; ", CS_NULLTERM, CS_UNUSED) -> CS_SUCCEED ct_send(cmd1) -> CS_SUCCEED _start_results ct_results(cmd1, &result) -> CS_SUCCEED, CS_STATUS_RESULT ct_res_info(cmd1, CS_NUMDATA, &value, CS_UNUSED, NULL) -> CS_SUCCEED, 1 ct_describe(cmd1, 1, &fmt) -> CS_SUCCEED, datafmt0=[name:"" type:CS_INT_TYPE status:CS_FALSE format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0] ct_bind(cmd1, 1, &datafmt0->fmt=[name:"" type:CS_INT_TYPE status:CS_FALSE format:CS_FMT_UNUSED count:1 maxlength:4 scale:0 precision:0], databuf0->buff, databuf0->copied, databuf0->indicator) -> CS_SUCCEED, databuf0 _set_state: _LAZY_FETCHING ct_cancel(conn0, NULL, CS_CANCEL_ALL) -> CS_SUCCEED _unlock: count -> 0 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_OPT_STATS_IO) -> CS_SUCCEED ct_con_drop(conn0) -> CS_SUCCEED Why would this happen? I'd really not like to have to requery every time that happens. -Josh On Wed, 4 Aug 2004 09:38:23 -0500, Josh Close <na...@gm...> wrote: > I am using sybase with mssql and freetds. When I execute a query I > will get 0 results most of the time when first ran. I will run it > again 1 second later and it will work just fine. > > Could this be a sybase error? Or possibly a freetds error? > > I did 'export TDSDUMP=/var/log/freetds.log' to see what freetds was > doing and got this > > 09:30:53.204554 tds_process_end: more_results = 0 > was_cancelled = 1 > error = 0 > done_count_valid = 0 > 09:30:53.204584 tds_process_end() state set to TDS_IDLE > 09:30:53.204852 ct_cmd_drop() > 09:30:53.204909 ct_con_props() action = CS_GET property = 26 > 09:30:53.204939 ct_close() > 09:30:53.205109 ct_con_drop() > > Does that mean that tds was cancelled at some point by sybase? > > Any help would be great. > > -Josh > |
From: Charles B. <Cha...@ut...> - 2004-08-05 09:03:33
|
> > >My question is how to supply authentication credentials to the MS SQL > > >Server. I have to use a domain login userid like DOMAIN\username. > When > > >I create a Python script like this: > > > > > >------------------------------------------------------------ > > >import Sybase > > > > > >dsn =3D 'theDb' > > >uid =3D 'MYDOMAIN\jrandomuser' > > >pwd =3D 'h4x0r' > > >cx =3D Sybase.connect(dsn, uid, pwd) > > > > > >cx.close() > > >------------------------------------------------------------ > > > > > > > > > > > Try: uid =3D 'MYDOMAIN\\jrandomuser' > > > > Don't forget Python's string quoting rules! ;) >=20 >=20 > Thanks for your response. I should have mentioned that I had already > tried several permutations of quoting, including raw strings and the > escaped backslash you recommended. Still no joy: the "Login failed for > user '(null)'" exception is still thrown. And when I catch that > exception to print 'uid' before re-raising the exception, it prints the > UID correctly, with the single backslash between domain and username > (and it does so whether or not I've escaped the backslash). >=20 > The UID and password I am actually using are my personal domain > credentials that I type in every day to log on. I'm puzzled by the > '(null)' user thing. Does that mean that the string I am passing as UID > is not getting through, or that it is not recognized? >=20 >=20 > Are your user accounts on the SQL Server using the integrated NT login for > authentication, or are they using a separate password? I don't know for > sure, but I'd wonder if FreeTDS supported the integrated login scheme. Yes, FreeTDS does handle domain logins correctly. In fact, I've now gotten it to work with the libiodbc driver manager and mx.ODBC. Also, the FreeTDS 'tsql' utility can connect with a domain login: $ ./tsql -S servername -U 'DOMAIN\uname' locale is "en_US.UTF-8" locale charset is "UTF-8" Password:=20 Msg 5703, Level 0, State 1, Server UT160617, Line 0 Changed language setting to us_english. 1> The only trick is not to supply the password on the command line, but at the prompt after executing the tsql command. But basically, FreeTDS as used by other interfaces is able to talk to the server in question, whatever the authentication method. For now I will probably just go with the mx.ODBC.iODBC interface, since it works. For security reasons, it would probably be good to get db-specific uids and passwords, rather than using my own credentials (I'm not the sysadmin or DBA here, so I don't make the policies). If the python-sybase developers think it would be useful, I would be willing a little later to send TDS dumps for successful logins via iODBC and for unsuccessful attempts via python-sybase. I don't know if it is a high priority for this project to make domain logins work with FreeTDS. Thanks for the responses, Chuck |
From: Josh C. <na...@gm...> - 2004-08-05 07:38:29
|
I am using sybase with mssql and freetds. When I execute a query I will get 0 results most of the time when first ran. I will run it again 1 second later and it will work just fine. Could this be a sybase error? Or possibly a freetds error? I did 'export TDSDUMP=/var/log/freetds.log' to see what freetds was doing and got this 09:30:53.204554 tds_process_end: more_results = 0 was_cancelled = 1 error = 0 done_count_valid = 0 09:30:53.204584 tds_process_end() state set to TDS_IDLE 09:30:53.204852 ct_cmd_drop() 09:30:53.204909 ct_con_props() action = CS_GET property = 26 09:30:53.204939 ct_close() 09:30:53.205109 ct_con_drop() Does that mean that tds was cancelled at some point by sybase? Any help would be great. -Josh |
From: Charles B. <Cha...@ut...> - 2004-08-05 07:23:16
|
> Ryan Felder wrote: > > I am working on a project that uses Sybase and Freetds under solaris to > > talk to a MSsql server, > > and code that seems to have worked in the past, no longer works with a > more > > up to date version of > > Sybase. > > > > We use a stored procedure to authenticate users, and when it fails, it > has > > a return code. I can > > not find how to retreive this return code any longer. Our code used to > > receive this in the first > > row of data returned, but now, we cannot find it. I am running this with > > current versions of > > Python, Sybase, and Freetds, under solaris 9. Anyone with ideas is my > > saviour. >=20 > My first step would be to see if the same failure happens when using > Perl and FreeTDS. This would tell you if the problem is in FreeTDS or > not. >=20 > I think it possible to get FreeTDS to produce copious debugging - this > might let you compare what the Python module is doing relative to the > Perl module. The FreeTDS User Guide has a page on logging[1]. In brief, set the TDSDUMP environment variable to the path of the file to which you want to log. [1] http://www.freetds.org/userguide/logging.htm Chuck Bearden Systems Analyst III School of Health Information Sciences University of Texas at Houston 713.500.3954 (voice) 713.500.3907 (fax) Cha...@ut... |
From: Dave C. <dj...@ob...> - 2004-08-04 18:07:52
|
Ryan Felder wrote: > I am working on a project that uses Sybase and Freetds under solaris to > talk to a MSsql server, > and code that seems to have worked in the past, no longer works with a more > up to date version of > Sybase. > > We use a stored procedure to authenticate users, and when it fails, it has > a return code. I can > not find how to retreive this return code any longer. Our code used to > receive this in the first > row of data returned, but now, we cannot find it. I am running this with > current versions of > Python, Sybase, and Freetds, under solaris 9. Anyone with ideas is my > saviour. My first step would be to see if the same failure happens when using Perl and FreeTDS. This would tell you if the problem is in FreeTDS or not. I think it possible to get FreeTDS to produce copious debugging - this might let you compare what the Python module is doing relative to the Perl module. - Dave -- http://www.object-craft.com.au |
From: Ryan F. <rf...@gl...> - 2004-08-04 15:11:50
|
I am working on a project that uses Sybase and Freetds under solaris to talk to a MSsql server, and code that seems to have worked in the past, no longer works with a more up to date version of Sybase. We use a stored procedure to authenticate users, and when it fails, it has a return code. I can not find how to retreive this return code any longer. Our code used to receive this in the first row of data returned, but now, we cannot find it. I am running this with current versions of Python, Sybase, and Freetds, under solaris 9. Anyone with ideas is my saviour. - Ryan Felder |