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: Erik T. <er...@th...> - 2004-07-22 08:05:02
|
hi. i am using - gentoo linux. - sybase-0.36 - freetds-0.62.3 - python 2.3.3 from this linux machine i am accessing a mssql 7 server on an nt4.0 windows server. i am doing db=Sybase.connect('myserver','myuser','mypass','mydb') c=db.cursor() c.execute('select * from foo where something=@x', {'@x' : "blabla"}) it sais: Sybase.DatabaseError: ------ Must declare the variable '@x' ??? i do not understand. why is this so? i am trying to use python DB API 2.0. but i find the documentation for this not very sufficient. there seems to be no good example at all on the net. questions never covered and done wrong in almost all examples is the issue with escaping the datatypes. some really do c.execute("select from where x="%s"" % mystring) this is of course fatal since mystring may contain closing " and then sql commands. anyway... how do i get the module to work? and... why is there several styles in DB API 2.0? i mean the Sybase.paramstyle thing. i thought DB API was there for portability, and then i find out that different modules have different ways to create sql queries. so there is absolute zero portability. why? thx & byebye Erik -- Erik Thiele |
From: Joshua Moore-O. <jo...@ch...> - 2004-07-20 15:58:48
|
Basically, whenever I insert a text field into a table, it gets a whitespace added to the end.. I am using Sybase 0.36 with freetds Here is a simple python script displaying this behaviour (server names and passwords removed for security) import Sybase sServer='' sUser='' sPassword='' sDbName='' conn = Sybase.connect( sServer, sUser, sPassword, sDbName ) cur = conn.cursor() cur.execute( "CREATE TABLE tblTest( iId int, sIp text );" ) sSql = ( 'INSERT INTO tblTest ( iId, sIp )\n' ' VALUES( 1, @sIp ); \n' ) cur.execute( sSql , { '@sIp' : '12.34.56.87' } ) After this scripts runs, run this command SELECT * FROM tblTest WHERE sIp LIKE '% '; you will see the row come up.. and just as further proof that it's not a weird LIKE operator.. UPDATE tblTest SET sIp = rtrim(CAST( sIp AS varchar )); will have show that it did indeed remove a space from the end as shown by a consecutive SELECT * FROM tblTest WHERE sIp LIKE '% '; Josh. |
From: Dave C. <dj...@ob...> - 2004-06-29 18:28:43
|
Dave Cole wrote: > Gregory Bond wrote: > >> We still have 11.5 (youch!!), 12.0 and 12.5 servers on Solaris we can >> test >> against. >> And if you ever get the bulkcopy implemented again we'd use it live! > > > Ben keeps tellng me to reimplement the bulkcopy stuff. If you are happy > to test it I should be able to do it over the weekend. Have been sick for the last two days. Getting bored at home so I had a crack at implementing bulkcopy again... Install the attached Sybase.py and try something like the following: import csv import Sybase db = Sybase.connect(server, user, passwd, database, delay_connect=1, auto_commit=1) db.set_property(Sybase.CS_BULK_LOGIN, Sybase.CS_TRUE) db.connect() blk = db.bulkcopy(table) for row in csv.reader(file("some.csv")): blk.rowxfer(row) blk.done() - Dave -- http://www.object-craft.com.au |
From: Dave C. <dj...@ob...> - 2004-06-24 17:03:55
|
Gregory Bond wrote: > We still have 11.5 (youch!!), 12.0 and 12.5 servers on Solaris we can test > against. > > And if you ever get the bulkcopy implemented again we'd use it live! Ben keeps tellng me to reimplement the bulkcopy stuff. If you are happy to test it I should be able to do it over the weekend. - Dave -- http://www.object-craft.com.au |
From: Gregory B. <gn...@it...> - 2004-06-24 16:11:47
|
We still have 11.5 (youch!!), 12.0 and 12.5 servers on Solaris we can test against. And if you ever get the bulkcopy implemented again we'd use it live! |
From: Skip M. <sk...@po...> - 2004-06-24 08:05:41
|
Dave & Stan, I seem to have reached a useful conclusion about my query involving dates. Our production Sybase server here is running 11.9.something while the Sybase module is built using the 12.5 OCS libraries. We have a test server running 12.5. Grasping at straws this morning I tried running the script against the test server. Voila! Valid results were returned! That seems to solve my problem. We will transition the test server to production in a couple weeks and in the meantime I can just use the test server directly. That doesn't solve the problem for the Sybase module though. I suppose it's possible that some bit is set incompatibly at the lower levels. I'd be happy to try some more debugging if you want. Just let me know. Thanks for the help, -- Skip Montanaro sk...@po... |
From: Skip M. <sk...@po...> - 2004-06-23 20:46:24
|
Dave> Ooops. I was confusing the Sybase module with another one of my Dave> modules... Should have checked the code. Try this: Dave> import Sybase Dave> Sybase._ctx.debug = 1 Dave> Sybase.set_debug(open('debug.log', 'w')) Dave> : Thanks, that worked much better. Attached is the debug.log file. I don't see anything obvious, but I'm not really sure what I'm looking at either... Skip |
From: Dave C. <dj...@ob...> - 2004-06-23 17:48:42
|
Skip Montanaro wrote: > Dave> Can you try doing something like the following: > > Dave> import Sybase > > Dave> Sybase.set_debug(open('debug.log', 'w')) > Dave> : > Dave> conn = Sybase.Connection(..., debug=1) > Dave> : > > Dave, > > Thanks for the response. Alas, there is no debug arg to the Connection > class constructor. (I'm using 0.36.) With just the set_debug() call > nothing turns up in debug.log. Is the debug argument something that's only > available from CVS? Ooops. I was confusing the Sybase module with another one of my modules... Should have checked the code. Try this: import Sybase Sybase._ctx.debug = 1 Sybase.set_debug(open('debug.log', 'w')) : - Dave -- http://www.object-craft.com.au |
From: Skip M. <sk...@po...> - 2004-06-23 17:32:44
|
Dave> Can you try doing something like the following: Dave> import Sybase Dave> Sybase.set_debug(open('debug.log', 'w')) Dave> : Dave> conn = Sybase.Connection(..., debug=1) Dave> : Dave, Thanks for the response. Alas, there is no debug arg to the Connection class constructor. (I'm using 0.36.) With just the set_debug() call nothing turns up in debug.log. Is the debug argument something that's only available from CVS? Skip |
From: Dave C. <dj...@ob...> - 2004-06-23 16:48:46
|
Skip Montanaro wrote: > >> I have a fairly straightforward query: > ... > >> that fails (returns no result rows) from Python. > > stan> a. Is it possible to get an error code from the > stan> cursor? It should be an attribute you can print. > > I don't see anything like an error attribute and cursor objects done have > __getattr__ methods so it can't be a dynamically retrieved thing. I also > checked the cursor's _fetcher attribute and the connection for error-like > attributes but didn't see anything. > > stan> b. Can it be that the date routine is not being > stan> called until after the main query has run? You could > stan> check this by declaring variables and setting them > stan> with the date call before you run the actual query. > stan> If the dates are unassigned while the query runs, you > stan> would get no results. > > I'm not sure what you mean here. When run, this code > > import Sybase > > q = """\ > SELECT trade_time, price > FROM underlying_daily_fp > WHERE symbol = @sym > AND instrument = @inst > AND trade_time BETWEEN @start AND @end > AND (price_type='H' or price_type='L') > ORDER BY trade_time DESC > """ > > args = {'@sym': 'ES', > '@start': Sybase.Date(2004, 4, 19), > '@end': Sybase.Date(2004, 5, 17), > '@inst': 'F' > } > > print [(k,type(v),v) for (k,v) in args.items()] > > conn = Sybase.Connection(...) > c = conn.cursor() > c.execute(q, args) > print c.fetchall() > > prints this output: > > [('@sym', <type 'str'>, 'ES'), ('@start', <type 'DateTimeType'>, 'Apr 19 > 2004 12:00AM'), ('@end', <type 'DateTimeType'>, 'May 17 2004 12:00AM'), > ('@inst', <type 'str'>, 'F')] > [] > > The DateTimeType objects are clearly created before the query executes. In > any case, I'm not sure what you mean by "declaring variables and setting > them with the date call". Is this something I embed in my query string? > > If I twiddle the trade_time clause to be any of > > AND trade_time >= @start > AND trade_time <= @end > > or > > AND trade_time >= @start > > or > > AND trade_time <= @end > > the query always returns empty results. If I remove the trade_time clause > altogether the query succeeds, but of course the date range of the returned > results is incorrect. Can you try doing something like the following: import Sybase Sybase.set_debug(open('debug.log', 'w')) : conn = Sybase.Connection(..., debug=1) : Then the module will produce quite a bit of debugging output in the log file. I hope that some of the output in the log file will shed some light on what is going on. - Dave -- http://www.object-craft.com.au |
From: Skip M. <sk...@po...> - 2004-06-23 12:05:46
|
>> I have a fairly straightforward query: ... >> that fails (returns no result rows) from Python. stan> a. Is it possible to get an error code from the stan> cursor? It should be an attribute you can print. I don't see anything like an error attribute and cursor objects done have __getattr__ methods so it can't be a dynamically retrieved thing. I also checked the cursor's _fetcher attribute and the connection for error-like attributes but didn't see anything. stan> b. Can it be that the date routine is not being stan> called until after the main query has run? You could stan> check this by declaring variables and setting them stan> with the date call before you run the actual query. stan> If the dates are unassigned while the query runs, you stan> would get no results. I'm not sure what you mean here. When run, this code import Sybase q = """\ SELECT trade_time, price FROM underlying_daily_fp WHERE symbol = @sym AND instrument = @inst AND trade_time BETWEEN @start AND @end AND (price_type='H' or price_type='L') ORDER BY trade_time DESC """ args = {'@sym': 'ES', '@start': Sybase.Date(2004, 4, 19), '@end': Sybase.Date(2004, 5, 17), '@inst': 'F' } print [(k,type(v),v) for (k,v) in args.items()] conn = Sybase.Connection(...) c = conn.cursor() c.execute(q, args) print c.fetchall() prints this output: [('@sym', <type 'str'>, 'ES'), ('@start', <type 'DateTimeType'>, 'Apr 19 2004 12:00AM'), ('@end', <type 'DateTimeType'>, 'May 17 2004 12:00AM'), ('@inst', <type 'str'>, 'F')] [] The DateTimeType objects are clearly created before the query executes. In any case, I'm not sure what you mean by "declaring variables and setting them with the date call". Is this something I embed in my query string? If I twiddle the trade_time clause to be any of AND trade_time >= @start AND trade_time <= @end or AND trade_time >= @start or AND trade_time <= @end the query always returns empty results. If I remove the trade_time clause altogether the query succeeds, but of course the date range of the returned results is incorrect. Thx, -- Skip Montanaro sk...@po... |
From: stan l. <st...@ya...> - 2004-06-19 16:41:27
|
--- Skip Montanaro <sk...@po...> wrote: > I have a fairly straightforward query: > > SELECT trade_time, price > FROM underlying_daily_fp d, underlying_months > m > WHERE d.instrument = @inst > AND d.symbol = @sym > AND m.instrument=d.instrument > AND m.symbol=d.symbol > AND (price_type='H' or price_type='L') > AND m.exp_year=d.exp_year > AND m.exp_month=d.exp_month > AND trade_time BETWEEN @start AND @end > AND d.trade_time=m.date > AND m.exp_num=1 > ORDER BY trade_time DESC > > with args: > > {'@sym': 'ES', > '@start': 'Apr 19 2004 12:00AM', > '@end': 'May 17 2004 12:00AM', > '@inst': 'F'} > > that fails (returns no result rows) from Python. > (The @start and @end > params are actually Sybase.Date() objects.) > However, the equivalent code > pasted into isql (using strings for dates) works as > expected: > > 1> select trade_time, price from > underlying_daily_fp d, underlying_months m > where d.instrument='F' > and d.symbol='ES' > and m.instrument=d.instrument > and m.symbol=d.symbol > and (price_type='H' or price_type='L') > AND m.exp_year=d.exp_year > AND m.exp_month=d.exp_month > AND trade_time BETWEEN 'Apr 19 2004 12:00AM' > and 'May 17 2004 12:00AM' > AND d.trade_time=m.date > AND m.exp_num=1 > ORDER BY trade_time DESC > 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> > 14> go > trade_time price > > -------------------------- -------------------- > > May 17 2004 12:00AM 1078.250000 > > May 17 2004 12:00AM 1089.250000 > > ... > Apr 19 2004 12:00AM 1135.250000 > > > (42 rows affected) > 1> > > Furthermore, if I manually expand the arguments and > call the connection's or > cursor's execute() methods: > > >>> q > "SELECT trade_time, price\n FROM > underlying_daily_fp d, underlying_months m\n WHERE > d.instrument = 'F'\n AND d.symbol = 'ES'\n AND > m.instrument=d.instrument\n AND > m.symbol=d.symbol\n AND (price_type='H' or > price_type='L')\n AND m.exp_year=d.exp_year\n > AND m.exp_month=d.exp_month\n AND trade_time > BETWEEN 'Apr 19 2004 12:00AM' AND 'May 17 2004 > 12:00AM'\n AND d.trade_time=m.date\n AND > m.exp_num=1\n ORDER BY trade_time DESC" > >>> len(db.execute(q)[0]) > 42 > >>> c = db.cursor() > >>> c.execute(q) > >>> len(c.fetchall()) > 42 > > it also works. > > Is it date handling? Is it possible to get the > actual SQL statement > executed by the server so I can see if and where > I've gone wrong? Do other > people experience this problem (works from isql but > not Python)? The > platform is OCS 12.5 and the latest version of the > Sybase module running on > Mandrake 10. > > Thanks, > > Skip Montanaro > sk...@po... > _______________________________________________ > Python-sybase mailing list > Pyt...@ww... > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase > Hi Skip, I don't have a solution to your problem, just a couple of suggestions. a. Is it possible to get an error code from the cursor? It should be an attribute you can print. b. Can it be that the date routine is not being called until after the main query has run? You could check this by declaring variables and setting them with the date call before you run the actual query. If the dates are unassigned while the query runs, you would get no results. Just some thoughts. Stan __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail |
From: Skip M. <sk...@po...> - 2004-06-19 13:54:40
|
I have a fairly straightforward query: SELECT trade_time, price FROM underlying_daily_fp d, underlying_months m WHERE d.instrument = @inst AND d.symbol = @sym AND m.instrument=d.instrument AND m.symbol=d.symbol AND (price_type='H' or price_type='L') AND m.exp_year=d.exp_year AND m.exp_month=d.exp_month AND trade_time BETWEEN @start AND @end AND d.trade_time=m.date AND m.exp_num=1 ORDER BY trade_time DESC with args: {'@sym': 'ES', '@start': 'Apr 19 2004 12:00AM', '@end': 'May 17 2004 12:00AM', '@inst': 'F'} that fails (returns no result rows) from Python. (The @start and @end params are actually Sybase.Date() objects.) However, the equivalent code pasted into isql (using strings for dates) works as expected: 1> select trade_time, price from underlying_daily_fp d, underlying_months m where d.instrument='F' and d.symbol='ES' and m.instrument=d.instrument and m.symbol=d.symbol and (price_type='H' or price_type='L') AND m.exp_year=d.exp_year AND m.exp_month=d.exp_month AND trade_time BETWEEN 'Apr 19 2004 12:00AM' and 'May 17 2004 12:00AM' AND d.trade_time=m.date AND m.exp_num=1 ORDER BY trade_time DESC 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> go trade_time price -------------------------- -------------------- May 17 2004 12:00AM 1078.250000 May 17 2004 12:00AM 1089.250000 ... Apr 19 2004 12:00AM 1135.250000 (42 rows affected) 1> Furthermore, if I manually expand the arguments and call the connection's or cursor's execute() methods: >>> q "SELECT trade_time, price\n FROM underlying_daily_fp d, underlying_months m\n WHERE d.instrument = 'F'\n AND d.symbol = 'ES'\n AND m.instrument=d.instrument\n AND m.symbol=d.symbol\n AND (price_type='H' or price_type='L')\n AND m.exp_year=d.exp_year\n AND m.exp_month=d.exp_month\n AND trade_time BETWEEN 'Apr 19 2004 12:00AM' AND 'May 17 2004 12:00AM'\n AND d.trade_time=m.date\n AND m.exp_num=1\n ORDER BY trade_time DESC" >>> len(db.execute(q)[0]) 42 >>> c = db.cursor() >>> c.execute(q) >>> len(c.fetchall()) 42 it also works. Is it date handling? Is it possible to get the actual SQL statement executed by the server so I can see if and where I've gone wrong? Do other people experience this problem (works from isql but not Python)? The platform is OCS 12.5 and the latest version of the Sybase module running on Mandrake 10. Thanks, Skip Montanaro sk...@po... |
From: Marcos P. <ma...@bu...> - 2004-06-12 12:29:58
|
It might be that the db server/api takes incorrect decisions about the type of the parameter... You may try casting the parameter: and symbol like cast(@s as varchar(100)) By the way, you might use sigle quotes around string constants, it is more portable (triple quotes around sql looks better too ;-) El jue, 10-06-2004 a las 15:18, Skip Montanaro escribi=F3: > Can someone explain why these two seemingly identical queries return > different results? Can't LIKE wildcards be given in parameter dictionari= es? >=20 > >>> c.execute('select distinct symbol, open_time, close_time,' > ... ' session_start, session_end, instrument= ' > ... ' from underlying_sessions' > ... ' where instrument =3D @i' > ... ' and symbol like "M%"', > ... {"@i": "E"}) > >>> len(c.fetchall()) > 402 > >>> c.execute('select distinct symbol, open_time, close_time,' > ... ' session_start, session_end, instrument= ' > ... ' from underlying_sessions' > ... ' where instrument =3D @i' > ... ' and symbol like @s', > ... {"@i": "E", > ... "@s": "M%"}) > >>> len(c.fetchall()) > 0 >=20 > Thanks, |
From: Skip M. <sk...@po...> - 2004-06-11 06:18:06
|
Can someone explain why these two seemingly identical queries return different results? Can't LIKE wildcards be given in parameter dictionaries? >>> c.execute('select distinct symbol, open_time, close_time,' ... ' session_start, session_end, instrument' ... ' from underlying_sessions' ... ' where instrument = @i' ... ' and symbol like "M%"', ... {"@i": "E"}) >>> len(c.fetchall()) 402 >>> c.execute('select distinct symbol, open_time, close_time,' ... ' session_start, session_end, instrument' ... ' from underlying_sessions' ... ' where instrument = @i' ... ' and symbol like @s', ... {"@i": "E", ... "@s": "M%"}) >>> len(c.fetchall()) 0 Thanks, -- Skip Montanaro Got gigs? http://www.musi-cal.com/submit.html Got spam? http://www.spambayes.org/ sk...@po... |
From: Skip M. <sk...@po...> - 2004-06-10 06:30:20
|
Markus> I am still stuck with what seems to be an Sybase error though: >>>> db = Sybase.connect('LINUX', 'sa', 'XXX') >>>> c=db.cursor() >>>> c.callproc('sp_help') Markus> Traceback (most recent call last): Markus> File "<stdin>", line 1, in ? Markus> File "/usr/lib/python2.3/site-packages/Sybase.py", line 653, in callproc Markus> self.description = fetcher.start(self.arraysize, out_params) Markus> File "/usr/lib/python2.3/site-packages/Sybase.py", line 338, in start Markus> return _FetchNow.start(self, arraysize) Markus> File "/usr/lib/python2.3/site-packages/Sybase.py", line 262, in start Markus> self._raise_error(Error, 'ct_send') Markus> File "/usr/lib/python2.3/site-packages/Sybase.py", line 287, in _raise_error Markus> raise exc(text) Markus> Sybase.Error: ct_send I don't recognize that. Do you also get it with something simple like c.execute("select 1") print c.fetchall() ? Skip |
From: <m.d...@BG...> - 2004-06-10 06:11:52
|
Hi Skip, thanks a lot! Works immediately and a lot easier than using ldconfig. I am still stuck with what seems to be an Sybase error though: >>> db =3D Sybase.connect('LINUX', 'sa', 'XXX') >>> c=3Ddb.cursor() >>> c.callproc('sp_help') Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.3/site-packages/Sybase.py", line 653, in = callproc self.description =3D fetcher.start(self.arraysize, out_params) File "/usr/lib/python2.3/site-packages/Sybase.py", line 338, in start return _FetchNow.start(self, arraysize) File "/usr/lib/python2.3/site-packages/Sybase.py", line 262, in start self._raise_error(Error, 'ct_send') File "/usr/lib/python2.3/site-packages/Sybase.py", line 287, in = _raise_error raise exc(text) Sybase.Error: ct_send thanks, Markus -----Original Message----- From: Skip Montanaro [mailto:sk...@po...] Sent: Mittwoch, 9. Juni 2004 15:00 To: D=F6ring, Markus Cc: pyt...@ww... Subject: Re: [python-sybase] Python Sybase-0.36 module with SUSE Linux 9.0 Try running=20 python setup.py build_ext --help There is a --rpath flag you can give when building extensions. I think something like python setup.py clean -a python setup.py build_ext --rpath=3D$SYBASE_OCS/lib python setup.py install would probably do the trick. --=20 Skip Montanaro Got gigs? http://www.musi-cal.com/submit.html Got spam? http://www.spambayes.org/ sk...@po... |
From: <m.d...@BG...> - 2004-06-10 06:05:30
|
Hello, I have found that when I manually force the dynamic linker to include = the sybase OCS library directory with ldconfig it works! It worked like this: linux:~/sybase-0.36 # ldconfig -p | grep sybase linux:~/sybase-0.36 # python setup.py build_ext linux:~/sybase-0.36 # ldd build/lib.linux-i686-2.3/sybasect.so libct.so =3D> /usr/local/sybase/OCS-12_5/lib/libct.so = (0x4003d000) libcs.so =3D> /usr/local/sybase/OCS-12_5/lib/libcs.so = (0x400ab000) libsybtcl.so =3D> /usr/local/sybase/OCS-12_5/lib/libsybtcl.so = (0x400b8000) libcomn.so =3D> /usr/local/sybase/OCS-12_5/lib/libcomn.so = (0x400f0000) libintl.so =3D> /usr/local/sybase/OCS-12_5/lib/libintl.so = (0x40154000) libpthread.so.0 =3D> /lib/i686/libpthread.so.0 (0x4015e000) libc.so.6 =3D> /lib/i686/libc.so.6 (0x401af000) /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x80000000) et voila! Hopefully this build works now... But is this the way to do it right? Thanks, Markus -----Original Message----- From: D=F6ring, Markus=20 Sent: Mittwoch, 9. Juni 2004 13:16 To: 'pyt...@ww...' Subject: Python Sybase-0.36 module with SUSE Linux 9.0 Hi, I am trying to get the sybase 0.36 module running on SUSE Linux 9.0 with = ASE 12.5 developer version installed in /usr/local/sybase I managed to compile the shared libraries and run python setup.py = install by setting the proper environment variables for SYBASE, = SYBASE_OCS and SYBASE_ASE. But it seems the sybasect.so file is not linked correctly. When I test the build file with ldd, I get this: ---------------------------------------- linux:~/sybase-0.36 # ldd build/lib.linux-i686-2.3/sybasect.so libct.so =3D> not found libcs.so =3D> not found libsybtcl.so =3D> not found libcomn.so =3D> not found libintl.so =3D> not found libpthread.so.0 =3D> /lib/i686/libpthread.so.0 (0x4003e000) libc.so.6 =3D> /lib/i686/libc.so.6 (0x4008f000) /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x80000000) ---------------------------------------- the gcc build gives me this: ---------------------------------------- gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=3D64 = -DHAVE_LARGEFILE_SUPPORT -O2 -march=3Di586 -mcpu=3Di686 = -fmessage-length=3D0 -fPIC -Wall -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC = -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT = -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO = -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC = -DHAVE_CS_CMP -I/usr/local/sybase/OCS-12_5/include = -I/usr/include/python2.3 -c sybasect.c -o = build/temp.linux-i686-2.3/sybasect.o ... gcc -pthread -shared build/temp.linux-i686-2.3/blk.o = build/temp.linux-i686-2.3/databuf.o build/temp.linux-i686-2.3/cmd.o = build/temp.linux-i686-2.3/conn.o build/temp.linux-i686-2.3/ctx.o = build/temp.linux-i686-2.3/datafmt.o build/temp.linux-i686-2.3/iodesc.o = build/temp.linux-i686-2.3/locale.o build/temp.linux-i686-2.3/msgs.o = build/temp.linux-i686-2.3/numeric.o build/temp.linux-i686-2.3/money.o = build/temp.linux-i686-2.3/datetime.o = build/temp.linux-i686-2.3/sybasect.o -L/usr/local/sybase/OCS-12_5/lib = -lblk -lct -lcs -lsybtcl -lcomn -lintl -o = build/lib.linux-i686-2.3/sybasect.so running install_lib copying build/lib.linux-i686-2.3/sybasect.so -> = /usr/lib/python2.3/site-packages Does anyone have an idea how to solve this? Any help greatly appreciated. Thanks, Markus -- Markus D=F6ring=20 Botanic Garden and Botanical Museum Berlin Dahlem,=20 Dept. of Biodiversity Informatics=20 K=F6nigin-Luise-Str. 6-8, D-14191 Berlin=20 Phone: +49 30 83850-284 Email: m.d...@bg...=20 |
From: Skip M. <sk...@po...> - 2004-06-10 06:01:23
|
Markus> When I test the build file with ldd, I get this: Markus> ---------------------------------------- Markus> linux:~/sybase-0.36 # ldd build/lib.linux-i686-2.3/sybasect.so Markus> libct.so => not found Markus> libcs.so => not found Markus> libsybtcl.so => not found Markus> libcomn.so => not found Markus> libintl.so => not found Markus> libpthread.so.0 => /lib/i686/libpthread.so.0 (0x4003e000) Markus> libc.so.6 => /lib/i686/libc.so.6 (0x4008f000) Markus> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000) ... Markus> Does anyone have an idea how to solve this? Markus> Any help greatly appreciated. Try running python setup.py build_ext --help There is a --rpath flag you can give when building extensions. I think something like python setup.py clean -a python setup.py build_ext --rpath=$SYBASE_OCS/lib python setup.py install would probably do the trick. -- Skip Montanaro Got gigs? http://www.musi-cal.com/submit.html Got spam? http://www.spambayes.org/ sk...@po... |
From: <m.d...@BG...> - 2004-06-10 04:16:16
|
Hi, I am trying to get the sybase 0.36 module running on SUSE Linux 9.0 with = ASE 12.5 developer version installed in /usr/local/sybase I managed to compile the shared libraries and run python setup.py = install by setting the proper environment variables for SYBASE, = SYBASE_OCS and SYBASE_ASE. But it seems the sybasect.so file is not linked correctly. When I test the build file with ldd, I get this: ---------------------------------------- linux:~/sybase-0.36 # ldd build/lib.linux-i686-2.3/sybasect.so libct.so =3D> not found libcs.so =3D> not found libsybtcl.so =3D> not found libcomn.so =3D> not found libintl.so =3D> not found libpthread.so.0 =3D> /lib/i686/libpthread.so.0 (0x4003e000) libc.so.6 =3D> /lib/i686/libc.so.6 (0x4008f000) /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x80000000) ---------------------------------------- the gcc build gives me this: ---------------------------------------- gcc -pthread -fno-strict-aliasing -DNDEBUG -D_FILE_OFFSET_BITS=3D64 = -DHAVE_LARGEFILE_SUPPORT -O2 -march=3Di586 -mcpu=3Di686 = -fmessage-length=3D0 -fPIC -Wall -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC = -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT = -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO = -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC = -DHAVE_CS_CMP -I/usr/local/sybase/OCS-12_5/include = -I/usr/include/python2.3 -c sybasect.c -o = build/temp.linux-i686-2.3/sybasect.o ... gcc -pthread -shared build/temp.linux-i686-2.3/blk.o = build/temp.linux-i686-2.3/databuf.o build/temp.linux-i686-2.3/cmd.o = build/temp.linux-i686-2.3/conn.o build/temp.linux-i686-2.3/ctx.o = build/temp.linux-i686-2.3/datafmt.o build/temp.linux-i686-2.3/iodesc.o = build/temp.linux-i686-2.3/locale.o build/temp.linux-i686-2.3/msgs.o = build/temp.linux-i686-2.3/numeric.o build/temp.linux-i686-2.3/money.o = build/temp.linux-i686-2.3/datetime.o = build/temp.linux-i686-2.3/sybasect.o -L/usr/local/sybase/OCS-12_5/lib = -lblk -lct -lcs -lsybtcl -lcomn -lintl -o = build/lib.linux-i686-2.3/sybasect.so running install_lib copying build/lib.linux-i686-2.3/sybasect.so -> = /usr/lib/python2.3/site-packages Does anyone have an idea how to solve this? Any help greatly appreciated. Thanks, Markus -- Markus D=F6ring=20 Botanic Garden and Botanical Museum Berlin Dahlem,=20 Dept. of Biodiversity Informatics=20 K=F6nigin-Luise-Str. 6-8, D-14191 Berlin=20 Phone: +49 30 83850-284 Email: m.d...@bg...=20 |
From: Skip M. <sk...@po...> - 2004-06-08 07:01:06
|
It seems more Pythonic to use None as a default parameter value instead of mutable objects like dictionaries and lists, even when the parameters aren't modified by the function. A simple patch for execute() and executemany() is attached. -- Skip Montanaro Got gigs? http://www.musi-cal.com/submit.html Got spam? http://www.spambayes.org/ sk...@po... |
From: Skip M. <sk...@po...> - 2004-06-08 06:56:12
|
Can someone explain why two select statements should yield different results? >>> c.execute('select instrument,point_value,currency,tick_size,min_price_change' ... ' from history..underlying_contract_data_fp' ... ' where symbol = @symbol' ... ' and instrument = @instrument', ... {"@symbol": "MSFT", "@instrument": "E"}) >>> c.fetchall() [] >>> c.execute('select instrument,point_value,currency,tick_size,min_price_change' ... ' from history..underlying_contract_data_fp' ... ' where symbol = @sym' ... ' and instrument = @inst', ... {"@sym": "MSFT", "@inst": "E"}) >>> c.fetchall() [('E', 1.0, 'US ', 0.01, 0.01)] It seems to be a bug in the Sybase module's parameter expansion. Is there some limitation on the length of a parameter key? This certainly suggests there is: >>> c.execute('select instrument,point_value,currency,tick_size,min_price_change' ... ' from history..underlying_contract_data_fp' ... ' where symbol = @sym' ... ' and instrument = @instrume', ... {"@sym": "MSFT", "@instrume": "E"}) >>> c.fetchall() [] >>> c.execute('select instrument,point_value,currency,tick_size,min_price_change' ... ' from history..underlying_contract_data_fp' ... ' where symbol = @sym' ... ' and instrument = @instrum', ... {"@sym": "MSFT", "@instrum": "E"}) >>> c.fetchall() [('E', 1.0, 'US ', 0.01, 0.01)] If there is, it should probably be documented. -- Skip Montanaro Got gigs? http://www.musi-cal.com/submit.html Got spam? http://www.spambayes.org/ sk...@po... |
From: Harri.pasanen <har...@tr...> - 2004-06-05 21:36:38
|
<html><body> <br> </body></html> |
From: Harri.pasanen <har...@tr...> - 2004-06-05 04:39:32
|
<html><body> <br> </body></html> |
From: Harri.pasanen <har...@tr...> - 2004-06-04 22:01:00
|
<html><body> <br> </body></html> |