From info at egenix.com Mon Jul 10 17:58:22 2006 From: info at egenix.com (eGenix Team: M.-A. Lemburg) Date: Mon Jul 10 17:01:22 2006 Subject: [egenix-users] ANN: eGenix mxODBC Zope Database Adapter 1.0.10 Message-ID: <44B26B0E.1060501@egenix.com> ________________________________________________________________________ ANNOUNCEMENT EGENIX.COM mxODBC Zope Database Adapter Version 1.0.10 Usable with Zope and the Plone CMS. Available for Zope 2.3 through 2.10 on Windows, Linux, Mac OS X, Solaris and FreeBSD ________________________________________________________________________ INTRODUCTION The eGenix mxODBC Zope Database Adapter allows you to easily connect your Zope or Plone installation to just about any database backend on the market today, giving you the reliability of the commercially supported eGenix product mxODBC and the flexibility of the ODBC standard as middle-tier architecture. The mxODBC Zope Database Adapter is highly portable, just like Zope itself and provides a high performance interface to all your ODBC data sources, using a single well-supported interface on Windows, Linux, Mac OS X, Solaris and FreeBSD. This makes it ideal for deployment in ZEO Clusters and Zope hosting environments where stability and high performance are a top priority, establishing an excellent basis and scalable solution for your Plone CMS. ________________________________________________________________________ NEWS We are pleased to announce a new version of our mxODBC Zope DA product. The Zope DA now fully supports 64-bit ODBC. A problem with 64-bit integers has been resolved in this release. Also new in this release is support for the upcoming Zope 2.10. We have successfully tested the mxODBC Zope DA with the latest beta of the upcoming Zope version. ________________________________________________________________________ UPGRADING If you have already bought mxODBC Zope DA 1.0.x licenses, you can use these license for the 1.0.10 version as well. There is no need to buy new licenses. The same is true for evaluation license users. ________________________________________________________________________ MORE INFORMATION For more information on the mxODBC Zope Database Adapter, licensing and download instructions, please visit our web-site: http://zope.egenix.com/ You can buy mxODBC Zope DA licenses online from the eGenix.com shop at: http://shop.egenix.com/ ________________________________________________________________________ Thank you, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jul 10 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From phil at xfr.co.uk Fri Jul 14 15:35:03 2006 From: phil at xfr.co.uk (Philip Kilner) Date: Fri Jul 14 15:35:14 2006 Subject: [egenix-users] Zope mxODBC DA - ConflictError Problem Message-ID: <44B79D87.1090200@xfr.co.uk> Hi Guys, I've been plagued by Conflict Errors for a few days now - initially, all relating to temporary storage. I've eliminated my use of the session to store user preferences, and although the temporary storage problem has been reduced or eliminated (early days yet) I am seeing these errors again, but now apparently related to the database adapter. The application is a fairly simple RDBMS application, using Zope TTW techniques, running under the Enfold version of Plone against MS SQL Server 2K. All database access is via bog standard TTW ZSQL methods. The errors I am now seeing are as follows: - Traceback (innermost last): Module Zope2.App.startup, line 167, in zpublisher_exception_hook Module ZPublisher.Publish, line 120, in publish Module Zope2.App.startup, line 233, in commit Module transaction._manager, line 84, in commit Module transaction._transaction, line 381, in commit Module transaction._transaction, line 379, in commit Module transaction._transaction, line 427, in _commitResources Module ZODB.Connection, line 637, in tpc_vote Module ZEO.ClientStorage, line 893, in tpc_vote Module ZEO.ClientStorage, line 877, in _check_serials ConflictError: database conflict error (oid 0x6d2a, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection, serial this txn started with 0x0366cf5837559b44 2006-07-14 12:40:12.969000, serial currently committed 0x0366cf586d44f300 2006-07-14 12:40:25.610000) FWIW, I have recently upgraded from 1.0.9 to 1.0.10 of the DA. Has anyone else seen anything similar, or can anyone give me a pointer as to how to troubleshoot this? -- Regards, PhilK "Human language continually changes, innit." - Stephen Juan From support at egenix.com Sat Jul 15 11:59:59 2006 From: support at egenix.com (eGenix Support: M.-A. Lemburg) Date: Sat Jul 15 11:00:06 2006 Subject: [egenix-users] Re: Struggling to read a simple date text format In-Reply-To: <44B88564.5000407@jpl.nasa.gov> References: <44B88564.5000407@jpl.nasa.gov> Message-ID: <44B8AE8F.7040101@egenix.com> [Please post such questions to egenix-users, so that others can benefit from the answers as well] Simon Hook wrote: > Hi, > > I have been trying to use DateTime but keep having problems with what I > think is a fairly standard format: > > "2005-05-05 10:10:10.00" > or > YYYY-MO-DD HH:MM:SS.ss > > its the fractional seconds that cause the problems. Below are some > examples that work and some that do not (examples "c" and "d", examples > that fail are commented out). Any idea how to get "c" and "d" to work? I > think "c" should work and there has to be some literal to tell strptime > to ignore a character but I cannot find it. > > Many thanks, > > Simon > > ------ > > from time import * > from mx.DateTime import * > > a=ISO.ParseDateTimeUTC("2005-05-05 10:10:10.00") > print a > > b=Parser.DateTimeFromString("2005-05-05 10:10:10.00") > print b > > # This fails > #c=Parser.DateTimeFromString("2005-05-05 10:10:10.00",'iso') > #print c This should read: >>> c=Parser.DateTimeFromString("2005-05-05 10:10:10.00",('iso',)) >>> print c 2005-05-05 10:10:10.00 > # This fails > # d=strptime("2005-05-05 10:10:10.00","%Y-%m-%d %H:%M:%S") > # print d This doesn't work, since the strptime %S parser doesn't support fractions, mainly because the structure which strptime returns uses integers for the seconds part. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jul 15 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From simon.j.hook at jpl.nasa.gov Sat Jul 15 10:58:50 2006 From: simon.j.hook at jpl.nasa.gov (Simon Hook) Date: Sat Jul 15 18:59:04 2006 Subject: [egenix-users] Re: Struggling to read a simple date text format In-Reply-To: <44B8AE8F.7040101@egenix.com> References: <44B88564.5000407@jpl.nasa.gov> <44B8AE8F.7040101@egenix.com> Message-ID: <44B91ECA.3020000@jpl.nasa.gov> Many thanks. I would like to suggest you include: from time import * from mx.DateTime import * c=Parser.DateTimeFromString("2005-05-05 10:10:10.00",('iso',)) print c as an example in the documentation to help others. S. eGenix Support: M.-A. Lemburg wrote: > [Please post such questions to egenix-users, so that others can benefit > from the answers as well] > > Simon Hook wrote: > >> Hi, >> >> I have been trying to use DateTime but keep having problems with what I >> think is a fairly standard format: >> >> "2005-05-05 10:10:10.00" >> or >> YYYY-MO-DD HH:MM:SS.ss >> >> its the fractional seconds that cause the problems. Below are some >> examples that work and some that do not (examples "c" and "d", examples >> that fail are commented out). Any idea how to get "c" and "d" to work? I >> think "c" should work and there has to be some literal to tell strptime >> to ignore a character but I cannot find it. >> >> Many thanks, >> >> Simon >> >> ------ >> >> from time import * >> from mx.DateTime import * >> >> a=ISO.ParseDateTimeUTC("2005-05-05 10:10:10.00") >> print a >> >> b=Parser.DateTimeFromString("2005-05-05 10:10:10.00") >> print b >> >> # This fails >> #c=Parser.DateTimeFromString("2005-05-05 10:10:10.00",'iso') >> #print c >> > > This should read: > > >>>> c=Parser.DateTimeFromString("2005-05-05 10:10:10.00",('iso',)) >>>> print c >>>> > 2005-05-05 10:10:10.00 > > >> # This fails >> # d=strptime("2005-05-05 10:10:10.00","%Y-%m-%d %H:%M:%S") >> # print d >> > > This doesn't work, since the strptime %S parser doesn't support > fractions, mainly because the structure which strptime > returns uses integers for the seconds part. > > From mal at egenix.com Sun Jul 16 17:44:38 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jul 16 16:44:42 2006 Subject: [egenix-users] Zope mxODBC DA - ConflictError Problem In-Reply-To: <44B79D87.1090200@xfr.co.uk> References: <44B79D87.1090200@xfr.co.uk> Message-ID: <44BA50D6.2040904@egenix.com> Philip Kilner wrote: > Hi Guys, > > I've been plagued by Conflict Errors for a few days now - initially, all > relating to temporary storage. I've eliminated my use of the session to > store user preferences, and although the temporary storage problem has > been reduced or eliminated (early days yet) I am seeing these errors > again, but now apparently related to the database adapter. > > The application is a fairly simple RDBMS application, using Zope TTW > techniques, running under the Enfold version of Plone against MS SQL > Server 2K. All database access is via bog standard TTW ZSQL methods. > > The errors I am now seeing are as follows: - > > Traceback (innermost last): > Module Zope2.App.startup, line 167, in zpublisher_exception_hook > Module ZPublisher.Publish, line 120, in publish > Module Zope2.App.startup, line 233, in commit > Module transaction._manager, line 84, in commit > Module transaction._transaction, line 381, in commit > Module transaction._transaction, line 379, in commit > Module transaction._transaction, line 427, in _commitResources > Module ZODB.Connection, line 637, in tpc_vote > Module ZEO.ClientStorage, line 893, in tpc_vote > Module ZEO.ClientStorage, line 877, in _check_serials > ConflictError: database conflict error (oid 0x6d2a, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection, serial this txn started > with 0x0366cf5837559b44 2006-07-14 12:40:12.969000, serial currently > committed 0x0366cf586d44f300 2006-07-14 12:40:25.610000) > > FWIW, I have recently upgraded from 1.0.9 to 1.0.10 of the DA. Which Zope version are you running ? Do you use connect-on-demand for the connection in question ? > Has anyone else seen anything similar, or can anyone give me a pointer > as to how to troubleshoot this? The Zope DA can generate lots of debug output if needed: To enable debugging output in the mxODBC Zope DA, you have two options: 1. set the _debug global variable from within Zope, e.g. via an external method: def enable_mxODBCZopeDA_debugging(container): from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 3 and call that method once after Zope startup. Note that the setting will not persist across Zope startups. 2. create a file ZopeDASettings.py in the directory Products/mxODBCZopeDA (the same directory where you find the ZopeDA.pyc file): ### Adjust ZopeDA global settings: # # Enable verbose debugging output: _debug = 3 # # Optionally enable leak testing (this let's the driver # always return an empty result set and can be used to # track connection related leaks) _leak_testing = 0 The mxODBC Zope DA will pick up this file upon restart of Zope and set the globals accordingly. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jul 16 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From simon.j.hook at jpl.nasa.gov Sun Jul 16 13:01:46 2006 From: simon.j.hook at jpl.nasa.gov (Simon Hook) Date: Sun Jul 16 21:01:51 2006 Subject: [egenix-users] Matplotlib (pylab) datetime incompatible with Egenix mxDateTime Message-ID: <44BA8D1A.5010008@jpl.nasa.gov> Hi, [cross posted to egenix and matplotlib] I have been using the egenix mxDateTime module and want to plot some of the dates with Matplotlib (pylab). Pylab uses num2date and date2num to covert datesandtimes to floating point values for plotting. Unfortunately if you give pylab date2num an egenix DateTime object, pylab bombs. Is there a simple way to use egenix DateTime objects with Pylab? Below is a simple example #D:\apps\Python23\python.exe from datetime import * from mx.DateTime import * from pylab import * # This works a=datetime(2005,10,10,5,5,5) print a # This works b=DateTime(2005,10,10,5,5,5) print b # This works c=date2num(a) print c # This fails d=date2num(b) print d The output and failure message is: 2005-10-10 05:05:05 2005-10-10 05:05:05.00 732229.211863 Traceback (most recent call last): File "datetime-problem.py", line 20, in ? d=date2num(b) File "D:\apps\Python23\lib\site-packages\matplotlib\dates.py", line 174, in da te2num if not iterable(d): return _to_ordinalf(d) File "D:\apps\Python23\lib\site-packages\matplotlib\dates.py", line 137, in _t o_ordinalf base = dt.toordinal() AttributeError: toordinal thanks, Simon From mal at egenix.com Sun Jul 16 22:47:02 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jul 16 21:47:10 2006 Subject: [egenix-users] Matplotlib (pylab) datetime incompatible with Egenix mxDateTime In-Reply-To: <44BA8D1A.5010008@jpl.nasa.gov> References: <44BA8D1A.5010008@jpl.nasa.gov> Message-ID: <44BA97B6.9020404@egenix.com> Simon Hook wrote: > Hi, > > [cross posted to egenix and matplotlib] > > I have been using the egenix mxDateTime module and want to plot some of > the dates with Matplotlib (pylab). Pylab uses num2date and date2num to > covert datesandtimes to floating point values for plotting. > Unfortunately if you give pylab date2num an egenix DateTime object, > pylab bombs. Is there a simple way to use egenix DateTime objects with > Pylab? > > Below is a simple example > > #D:\apps\Python23\python.exe > > from datetime import * > from mx.DateTime import * > from pylab import * > > # This works > a=datetime(2005,10,10,5,5,5) > print a > > # This works > b=DateTime(2005,10,10,5,5,5) > print b > > # This works > c=date2num(a) > print c > > # This fails > d=date2num(b) > print d > > The output and failure message is: > > 2005-10-10 05:05:05 > 2005-10-10 05:05:05.00 > 732229.211863 I'm not sure what date2num() uses as epoch, but it looks like some variant of a Julian Day Number: >>> b.jdn 2453653.711863426 >>> b.tjd 3653.2118634259259 > Traceback (most recent call last): > File "datetime-problem.py", line 20, in ? > d=date2num(b) > File "D:\apps\Python23\lib\site-packages\matplotlib\dates.py", line > 174, in da > te2num > if not iterable(d): return _to_ordinalf(d) > File "D:\apps\Python23\lib\site-packages\matplotlib\dates.py", line > 137, in _t > o_ordinalf > base = dt.toordinal() > AttributeError: toordinal .toordinal() is a datetime method which is not supported by mxDateTime instances. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jul 16 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From simon.j.hook at jpl.nasa.gov Sun Jul 16 17:02:59 2006 From: simon.j.hook at jpl.nasa.gov (Simon Hook) Date: Mon Jul 17 01:03:04 2006 Subject: [egenix-users] Re: [Matplotlib-users] Matplotlib (pylab) datetime incompatiblewith Egenix mxDateTime In-Reply-To: <87ac792vg2.fsf@peds-pc311.bsd.uchicago.edu> References: <44BA8D1A.5010008@jpl.nasa.gov> <87ac792vg2.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <44BAC5A3.1030907@jpl.nasa.gov> Works like a champ. Thank you, S. John Hunter wrote: >>>>>> "Simon" == Simon Hook writes: >>>>>> > > Simon> Hi, [cross posted to egenix and matplotlib] > > Simon> I have been using the egenix mxDateTime module and want to > Simon> plot some of the dates with Matplotlib (pylab). Pylab uses > Simon> num2date and date2num to covert datesandtimes to floating > Simon> point values for plotting. Unfortunately if you give pylab > Simon> date2num an egenix DateTime object, pylab bombs. Is there a > Simon> simple way to use egenix DateTime objects with Pylab? > > See matplotlib.dates.mx2num > > JDH > From phil at xfr.co.uk Mon Jul 17 11:09:34 2006 From: phil at xfr.co.uk (Philip Kilner) Date: Mon Jul 17 11:10:19 2006 Subject: [egenix-users] Zope mxODBC DA - ConflictError Problem In-Reply-To: <44BA50D6.2040904@egenix.com> References: <44B79D87.1090200@xfr.co.uk> <44BA50D6.2040904@egenix.com> Message-ID: <44BB53CE.6030801@xfr.co.uk> Hi Marc-Andre, M.-A. Lemburg wrote: > Which Zope version are you running ? > Zope version is currently 2.8.6. > Do you use connect-on-demand for the connection in question ? > No, this connection is open all the time. FWIW, since asking for help here, it has been suggested that these conflict errors may be related to long transactions, and I have had some success at reducing their frequency by addressing query performance on the db side. > The Zope DA can generate lots of debug output if needed: > > To enable debugging output in the mxODBC Zope DA, you have two > options: > > 1. set the _debug global variable from within Zope, e.g. via > an external method: > > def enable_mxODBCZopeDA_debugging(container): > from Products.mxODBCZopeDA import ZopeDA > ZopeDA._debug = 3 > > and call that method once after Zope startup. Note that > the setting will not persist across Zope startups. > > 2. create a file ZopeDASettings.py in the directory > Products/mxODBCZopeDA (the same directory where you > find the ZopeDA.pyc file): > > ### Adjust ZopeDA global settings: > # > # Enable verbose debugging output: > _debug = 3 > # > # Optionally enable leak testing (this let's the driver > # always return an empty result set and can be used to > # track connection related leaks) > _leak_testing = 0 > > The mxODBC Zope DA will pick up this file upon > restart of Zope and set the globals accordingly. > Thanks - I'll have a go at this, initially outside working hours... -- Regards, PhilK "Human language continually changes, innit." - Stephen Juan From Peter.Frey at haufe.de Thu Jul 27 16:37:08 2006 From: Peter.Frey at haufe.de (Frey, Peter) Date: Thu Jul 27 15:37:03 2006 Subject: [egenix-users] unixODBC Connect raises NotSupportedError [unixODBC]Option not supported Message-ID: Hi, I am evaluating mxODBC for a data transfer/transformation task from a SQLServer 2005 database (running on a Windows2003 server) to a PosgreSQL Server (under Debian linux) The problem: when I try to connect to the SQL Server through mxODBC with the following python statement, I get an mxODBC.NotSupportedError exception. Details: When I execute the statement is Database = import_database('unixODBC') conn = Database.Connect('MSSQLDev0', user='sa', password='***') I get the exception mxODBC.NotSupportedError: ('S1C00', 1, '[unixODBC]Option not supported', 5921) Note: import_database is: def import_database(pkgname): try: Database = __import__('mx.ODBC.%s' % pkgname, locals(), globals(), '*') except ImportError,why: raise RuntimeError, 'Import of mx.ODBC.%s failed: %s' % (pkgname,why) return Database (similar to what I saw in site-packages/mx/ODBC/Misc/test.py) The same error message is also returned when running site-packages/mx/ODBC/Misc/test.py python /usr/lib/python2.4/site-packages/mx/ODBC/Misc/test.py Subpackage Name [MySQL]: unixODBC DriverConnect arguments [DSN=mysql;UID=root;PWD=mysql-admin]: DSN=MSSQLDev0;UID=sa;PWD=*** (remaining options left default) Testing package mx.ODBC.unixODBC version: 2.0.5 compiled with Unicode support using Python version: 2.4 Test suite: Connecting to the database. Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mx/ODBC/Misc/test.py", line 2346, in ? rc = main(packagename) File "/usr/lib/python2.4/site-packages/mx/ODBC/Misc/test.py", line 2278, in main connection = apply(connectapi,connectargs) mxODBC.NotSupportedError: ('S1C00', 1, '[unixODBC]Option not supported', 5921) I tested also connecting to a local PostgreSQL server and it works as expected. The problem must be on the mxODBC side, as both tsql and isql from FreeTDS work without problems with the same datasource. I checked also the ODBC troubleshooting section in the FreeTDS documentation, but isql -v MSSQLDev0 sa *** Works without any problem, I can connect to the SQLServer and issue SELECT statemens without problems. My .odbc.ini contains the following datasource definition for MSSQLDev0: [MSSQLDev0] Description = ARSystem database under Microsoft SQLServer 2005 on vg100hrsdev0 Driver = FreeTDS Server = vg100hrsdev0 Database = ARSystem Port = 1433 Database = ARSystem Using ODBC driver FreeTDS as set up by unixODBC in /etc/odbcinst.ini: [FreeTDS] Description = TDS driver (Sybase/MS SQL) Driver = /usr/lib/odbc/libtdsodbc.so Setup = /usr/lib/odbc/libtdsS.so CPTimeout = CPReuse = FileUsage = 1 I first had this problem using FreeTDS from the Debian (stable) package freetds-dev 0.61-6.2. I deinstalled it and compiled freetds 0.64 from source, but this did not solve my problem, still same error message. So, which Option is not supported by mxODBC or the FreeTDS ODBC driver? Peter From mal at egenix.com Thu Jul 27 16:56:09 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jul 27 15:56:14 2006 Subject: [egenix-users] unixODBC Connect raises NotSupportedError [unixODBC]Option not supported In-Reply-To: References: Message-ID: <44C8C5F9.70901@egenix.com> Dear Mr. Frey, > I am evaluating mxODBC for a data transfer/transformation task from a > SQLServer 2005 database (running on a Windows2003 server) to a PosgreSQL > Server (under Debian linux) > > The problem: when I try to connect to the SQL Server through mxODBC with > the following python statement, I get an mxODBC.NotSupportedError > exception. > > Details: > When I execute the statement is > > Database = import_database('unixODBC') > conn = Database.Connect('MSSQLDev0', user='sa', password='***') > > I get the exception > > mxODBC.NotSupportedError: ('S1C00', 1, '[unixODBC]Option not > supported', 5921) This is an error message generated by the ODBC driver (FreeTDS) that you're using. It complains at mxODBC asking it for a certain feature. There are two ways to work-around this: 1. Setup and run mxODBC on the Windows machine and use the standard SQL Server ODBC driver and the PostgreSQL ODBC driver on that machine. 2. Patch mxODBC to ignore the error from the driver, ie. replace these lines in unixODBC/mxODBC.c and reinstall mxODBC: /* Mixing SQLGetData with SQLBindColumn: */ rc = SQLGetInfo(dbc->hdbc, SQL_GETDATA_EXTENSIONS, (SQLPOINTER)value, (SQLSMALLINT)sizeof(value), &value_len); mxODBC_SQLCheck(henv,dbc->hdbc,SQL_NULL_HSTMT); dbc->getdata_extensions = *(long *)value; change the above to: value_len = sizeof(value); rc = SQLGetInfo(dbc->hdbc, SQL_GETDATA_EXTENSIONS, (SQLPOINTER)value, (SQLSMALLINT)sizeof(value), &value_len); if (rc != SQL_SUCCESS) { *value = 0; value_len = 0; dbc->getdata_extensions = 0; } else { dbc->getdata_extensions = *(long *)value; } I'd suggest that you use approach 1, since the FreeTDS ODBC driver is not all that reliable. It's getting better with each new release, but we still often get complaints from users that it sometimes returns empty result sets, munges data or does other weird things which don't happen with commercial drivers such as the ones from EasySoft, OpenLink and the others. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jul 27 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From Peter.Frey at haufe.de Thu Jul 27 17:04:42 2006 From: Peter.Frey at haufe.de (Frey, Peter) Date: Thu Jul 27 16:04:38 2006 Subject: AW: [egenix-users] unixODBC Connect raises NotSupportedError [unixODBC]Option not supported In-Reply-To: <44C8C5F9.70901@egenix.com> Message-ID: Dr. Mr Lemburg Thanks for the quick reply. We will go for option 2, patching mxODBC as the requirement of the project is to have it run on the Linux platform and not on the Windows side. And also we do not use mxODBC provide access to the SQLServer for an application/webserver but rather to have a mean to transfer (and transform) information from a larger (commercial) SQLServer database in form of a data snapshot to a PostgreSQL database. It will be this PostgreSQL database then is used for the data access by our webservers where availability, performance and reliability will be critical. Regards, Peter Frey -----Urspr?ngliche Nachricht----- Von: M.-A. Lemburg [mailto:mal@egenix.com] Gesendet: Donnerstag, 27. Juli 2006 15:56 An: Frey, Peter Cc: egenix-users@egenix.com Betreff: Re: [egenix-users] unixODBC Connect raises NotSupportedError [unixODBC]Option not supported Dear Mr. Frey, > I am evaluating mxODBC for a data transfer/transformation task from a > SQLServer 2005 database (running on a Windows2003 server) to a PosgreSQL > Server (under Debian linux) > > The problem: when I try to connect to the SQL Server through mxODBC with > the following python statement, I get an mxODBC.NotSupportedError > exception. > > Details: > When I execute the statement is > > Database = import_database('unixODBC') > conn = Database.Connect('MSSQLDev0', user='sa', password='***') > > I get the exception > > mxODBC.NotSupportedError: ('S1C00', 1, '[unixODBC]Option not > supported', 5921) This is an error message generated by the ODBC driver (FreeTDS) that you're using. It complains at mxODBC asking it for a certain feature. There are two ways to work-around this: 1. Setup and run mxODBC on the Windows machine and use the standard SQL Server ODBC driver and the PostgreSQL ODBC driver on that machine. 2. Patch mxODBC to ignore the error from the driver, ie. replace these lines in unixODBC/mxODBC.c and reinstall mxODBC: /* Mixing SQLGetData with SQLBindColumn: */ rc = SQLGetInfo(dbc->hdbc, SQL_GETDATA_EXTENSIONS, (SQLPOINTER)value, (SQLSMALLINT)sizeof(value), &value_len); mxODBC_SQLCheck(henv,dbc->hdbc,SQL_NULL_HSTMT); dbc->getdata_extensions = *(long *)value; change the above to: value_len = sizeof(value); rc = SQLGetInfo(dbc->hdbc, SQL_GETDATA_EXTENSIONS, (SQLPOINTER)value, (SQLSMALLINT)sizeof(value), &value_len); if (rc != SQL_SUCCESS) { *value = 0; value_len = 0; dbc->getdata_extensions = 0; } else { dbc->getdata_extensions = *(long *)value; } I'd suggest that you use approach 1, since the FreeTDS ODBC driver is not all that reliable. It's getting better with each new release, but we still often get complaints from users that it sometimes returns empty result sets, munges data or does other weird things which don't happen with commercial drivers such as the ones from EasySoft, OpenLink and the others. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jul 27 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::