From anthony.tuininga at gmail.com Tue Oct 2 15:58:16 2007 From: anthony.tuininga at gmail.com (Anthony Tuininga) Date: Tue, 2 Oct 2007 07:58:16 -0600 Subject: [DB-SIG] odbc module choices In-Reply-To: <46FFEAAB.1030403@egenix.com> References: <46FFBEF0.2060206@personnelware.com> <46FFEAAB.1030403@egenix.com> Message-ID: <703ae56b0710020658y9035570g314b20805a4c736f@mail.gmail.com> On 9/30/07, M.-A. Lemburg wrote: > On 2007-09-30 17:21, Carl Karsten wrote: > > Why are there 3 opensource odbc modules? > > > > and what are the differences between them? > > > > From what I can tell, the stock odbc module doesn't implement some important > > functions, like Tables() and Columns(). > > mxODBC introduced those catalog methods. > > Here's a run-down (totally unbiased, of course ;-): Of course. :-) > The win32 odbc module is really old (it was one of the first database > modules written for Python and triggered the DB-API specification). It > only supports DB-API 1.0. Agreed. It works, but only for limited definitions. :-) > mxODBC was started in 1997 and maintained ever since. It triggered > DB-API spec 2.0 and implements it. mxODBC supports ODBC drivers on all > platforms where you can compile Python, including (but not limited to) > Windows, Linux, Solaris, Mac OS X, FreeBSD, AIX and HP-UX. > It's actively supported&maintained by eGenix. A great module. Its only drawback (in my opinion, of course) is that it is not free. Its source may not be available either -- at the very least it is not readily available. The costs make it untenable for small projects to use. Again, just my opinion. > AFAIK, pyodbc has been in development for about a year. It's mostly a > Windows module, focusses on MS SQL Server and implements DB-API 2.0. I missed this one when I first did a search for ODBC modules. I found it later but it has a number of missing features that I wanted. By that point I had found that using the code for cx_Oracle as a base was far better than using the pyodbc code as a base. > ceodbc has just been released. Can't say much about it. I am the author of this module so if you have any questions about it, feel free to ask. I think I've explained why I didn't want to use the other three choices available. As for working together, the odbc module code is too old to be of much use. The mxODBC code is under an incompatible license (if it is available). That leaves the pydobc module which I'd be happy to work with as much as possible. The pyodbc module is written in C++ and the ceODBC module is written in C which makes that a little more difficult, though. As I already explained, I believe the cx_Oracle code gave me the ability to leapfrog over the pyodbc code -- but that's my opinion. Feel free to disagree with me. :-) > Hope that helps, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Sep 30 2007) > >>> 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,MacOSX for free ! :::: > > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig From anthony.tuininga at gmail.com Wed Oct 3 03:18:09 2007 From: anthony.tuininga at gmail.com (Anthony Tuininga) Date: Tue, 2 Oct 2007 19:18:09 -0600 Subject: [DB-SIG] cx_Oracle 4.3.3 Message-ID: <703ae56b0710021818y2d448673md32bbe9e1af99f71@mail.gmail.com> What is cx_Oracle? cx_Oracle is a Python extension module that allows access to Oracle and conforms to the Python database API 2.0 specifications with a few exceptions. Where do I get it? http://cx-oracle.sourceforge.net What's new? 1) Added method ping() on connections which can be used to test whether or not a connection is still active (available in Oracle 10g R2). 2) Added method cx_Oracle.clientversion() which returns a 5-tuple giving the version of the client that is in use (available in Oracle 10g R2). 3) Added methods startup() and shutdown() on connections which can be used to startup and shutdown databases (available in Oracle 10g R2). 4) Added support for Oracle 11g. 5) Added samples directory which contains a handful of scripts containing sample code for more advanced techniques. More will follow in future releases. 6) Prevent error "ORA-24333: zero iteration count" when calling executemany() with zero rows as requested by Andreas Mock. 7) Added methods __enter__() and __exit__() on connections to support using connections as context managers in Python 2.5 and higher. The context managed is the transaction state. Upon exit the transaction is either rolled back or committed depending on whether an exception took place or not. 8) Make the search for the lib32 and lib64 directories automatic for all platforms. 9) Tweak the setup configuration script to include all of the metadata and allow for building the module within another setup configuration script 10) Include the Oracle version in addition to the Python version in the build directories that are created and in the names of the binary packages that are created. 11) Remove unnecessary dependency on win32api to build module on Windows. Anthony Tuininga From anthony.tuininga at gmail.com Wed Oct 3 04:17:03 2007 From: anthony.tuininga at gmail.com (Anthony Tuininga) Date: Tue, 2 Oct 2007 20:17:03 -0600 Subject: [DB-SIG] cx_OracleDBATools 3.0b1 Message-ID: <703ae56b0710021917v747cb65cg284982e1afb35aa@mail.gmail.com> What is cx_OracleDBATools? cx_OracleDBATools is a set of Python scripts that handle Oracle DBA tasks in a cross platform manner. These scripts are intended to work the same way on all platforms and hide the complexities involved in managing Oracle databases, especially on Windows. Binaries are provided for those who do not have a Python installation. Where do I get it? http://cx-oradbatools.sourceforge.net What's new? 1) Changed backup and restore to use RMAN which allows for backups while the database is running. The backup utility can now create directories, uncompressed tar files or tar files compressed with either gzip or bzip2 as desired. Server parameter files (spfiles) and password files are now backed up correctly. 2) Added support for Oracle 11g. 3) On Windows, configuration is now read from the service directly and the situation where the database is configured to start when the service starts is now handled correctly. 4) Created build configuration script using the new version of cx_Freeze which allows for building installer images on Windows and RPM packages on Linux. 5) Added documentation. 6) The cx_Logging module is now used for all logging instead of simply being printed to stdout or stderr. Anthony Tuininga From ken at seehart.com Thu Oct 4 10:37:49 2007 From: ken at seehart.com (Ken Seehart) Date: Thu, 04 Oct 2007 01:37:49 -0700 Subject: [DB-SIG] (slightly off topic) Very Large Database recommendations? Message-ID: <4704A65D.9060701@seehart.com> I have a potential very large database application with these very approximate specs: Overall size: 1TB (growing by 1TB every few years or so) 1,000,000 new rows per day in the main table (never deleted, so this is also a growth rate) 2KB per row 1,000 queries per minute Very simple table structure. I suppose that python is not really relevant to the question since it would be a web database service where the client is python. Right now I am interested in getting an idea of how much such a system would cost, and where to look for solutions. Any ideas where I could look for information relevant to this question? -Ken From mal at egenix.com Thu Oct 4 11:16:35 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 04 Oct 2007 11:16:35 +0200 Subject: [DB-SIG] (slightly off topic) Very Large Database recommendations? In-Reply-To: <4704A65D.9060701@seehart.com> References: <4704A65D.9060701@seehart.com> Message-ID: <4704AF73.1000604@egenix.com> Ken Seehart wrote: > I have a potential very large database application with these very > approximate specs: > > Overall size: 1TB (growing by 1TB every few years or so) > 1,000,000 new rows per day in the main table (never deleted, so this is > also a growth rate) > 2KB per row > 1,000 queries per minute > > Very simple table structure. > > I suppose that python is not really relevant to the question since it > would be a web database service where the client is python. > > Right now I am interested in getting an idea of how much such a system > would cost, and where to look for solutions. > > Any ideas where I could look for information relevant to this question? The table size doesn't look all that big. Any of Oracle, DB2 or even PostgreSQL should be able to handle it. For larger databases you should have a look at special database systems such as TeraData and Netezza. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 04 2007) >>> 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,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From fog at initd.org Thu Oct 4 12:17:57 2007 From: fog at initd.org (Federico Di Gregorio) Date: Thu, 04 Oct 2007 12:17:57 +0200 Subject: [DB-SIG] (slightly off topic) Very Large Database recommendations? In-Reply-To: <4704AF73.1000604@egenix.com> References: <4704A65D.9060701@seehart.com> <4704AF73.1000604@egenix.com> Message-ID: <1191493077.11855.4.camel@mila.office.dinunzioedigregorio> Il giorno gio, 04/10/2007 alle 11.16 +0200, M.-A. Lemburg ha scritto: > > I suppose that python is not really relevant to the question since > it > > would be a web database service where the client is python. > > > > Right now I am interested in getting an idea of how much such a > system > > would cost, and where to look for solutions. > > > > Any ideas where I could look for information relevant to this > question? > > The table size doesn't look all that big. Any of Oracle, DB2 or > even PostgreSQL should be able to handle it. If I remeber correctly I once got an email from a US hospital that was using PostgreSQL + psycopg to store medical data and full images into the database. They had millions of lines and were about to buy a 6TB SAN for the storage. You would be quite safe with 1,000,000 rows and 1TB of data. federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog at debian.org INIT.D Developer fog at initd.org Best friends are often failed lovers. -- Me -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio firmata digitalmente Url : http://mail.python.org/pipermail/db-sig/attachments/20071004/157dced1/attachment.pgp From carsten at uniqsys.com Thu Oct 4 14:53:09 2007 From: carsten at uniqsys.com (Carsten Haese) Date: Thu, 04 Oct 2007 08:53:09 -0400 Subject: [DB-SIG] (slightly off topic) Very Large Database recommendations? In-Reply-To: <4704AF73.1000604@egenix.com> References: <4704A65D.9060701@seehart.com> <4704AF73.1000604@egenix.com> Message-ID: <1191502389.3373.16.camel@dot.uniqsys.com> On Thu, 2007-10-04 at 11:16 +0200, M.-A. Lemburg wrote: > > Right now I am interested in getting an idea of how much such a system > > would cost, and where to look for solutions. > > > > Any ideas where I could look for information relevant to this question? > > The table size doesn't look all that big. Any of Oracle, DB2 or > even PostgreSQL should be able to handle it. And let's throw my personal favorite, IBM Informix, into the mix, too. Your best bet for estimating cost is probably to ask on each database's user group mailing list for recommendations. Each choice comes with its own set of cost factors that you must carefully weigh against each other: Hardware requirements, initial licensing cost, if any, maintenance cost, if any, how many DBAs you need and how expensive they are, etc. When you do ask for those recommendations, be prepared not only to mention the data volume and query rate, but also the expected number of users, whether the database should be replicated, how much downtime you can afford for routine maintenance tasks, for backups, and for product upgrades. All those factors can play a role in making a decision. Or you could just go with Informix and call it a day ;-) HTH, -- Carsten Haese http://informixdb.sourceforge.net From fortier at atmoauvergne.asso.fr Thu Oct 4 17:46:05 2007 From: fortier at atmoauvergne.asso.fr (yann FORTIER) Date: Thu, 04 Oct 2007 15:46:05 +0000 Subject: [DB-SIG] probleme with cx_oracle Message-ID: <47050ABD.9040603@atmoauvergne.asso.fr> Hello, I used cx_oracle with python to recover some data (string) in my base oracle. But I have a problem between what I have in my base (with sqlplus) and what I recover with python. I don't have any accent. I'm french so it's important for us. Can you help us. Thanks -- Yann FORTIER From sdavis2 at mail.nih.gov Fri Oct 5 13:26:11 2007 From: sdavis2 at mail.nih.gov (Sean Davis) Date: Fri, 05 Oct 2007 07:26:11 -0400 Subject: [DB-SIG] (slightly off topic) Very Large Database recommendations? In-Reply-To: <1191493077.11855.4.camel@mila.office.dinunzioedigregorio> References: <4704A65D.9060701@seehart.com> <4704AF73.1000604@egenix.com> <1191493077.11855.4.camel@mila.office.dinunzioedigregorio> Message-ID: <47061F53.3060002@mail.nih.gov> Federico Di Gregorio wrote: > Il giorno gio, 04/10/2007 alle 11.16 +0200, M.-A. Lemburg ha scritto: > >>> I suppose that python is not really relevant to the question since >>> >> it >> >>> would be a web database service where the client is python. >>> >>> Right now I am interested in getting an idea of how much such a >>> >> system >> >>> would cost, and where to look for solutions. >>> >>> Any ideas where I could look for information relevant to this >>> >> question? >> >> The table size doesn't look all that big. Any of Oracle, DB2 or >> even PostgreSQL should be able to handle it. >> > > If I remeber correctly I once got an email from a US hospital that was > using PostgreSQL + psycopg to store medical data and full images into > the database. They had millions of lines and were about to buy a 6TB SAN > for the storage. You would be quite safe with 1,000,000 rows and 1TB of > data. > I'm a postgres user, but I have used Oracle and MySQL as well. Any of these databases on appropriate hardware will deal with VERY large datasets (on the order of several TB of data with billions of rows). As the database becomes larger, more hardware becomes necessary (more memory, in particular) and it becomes more complicated to manage schema to keep the database quick (if that is important), but size is really not a limiting factor for most practical purposes. If you have many simultaneous queries, then you will have a slightly different set of problems and will need to think about setting up clusters, but only careful testing will tell you what is going to be needed in the end. Sean From unixdude at gmail.com Sat Oct 6 17:27:55 2007 From: unixdude at gmail.com (Jim Patterson) Date: Sat, 6 Oct 2007 11:27:55 -0400 Subject: [DB-SIG] probleme with cx_oracle In-Reply-To: <47050ABD.9040603@atmoauvergne.asso.fr> References: <47050ABD.9040603@atmoauvergne.asso.fr> Message-ID: On 10/4/07, yann FORTIER wrote: > But I have a problem between what I have in my base (with sqlplus) and > what I recover with python. I don't have any accent. I'm french so it's > important for us. Can you help us. The key to extracting non-ASCII data is to set your NLS_LANG environment before you import cx_oracle. I would suggest using AL32UTF8 as the Oracle language. That will get you a nice modern UTF-8 that you can decode into a unicode string in python. You may also want to ask cx_oracle questions on the cx_oracle list. It will get you faster response. Jim P. From carsten at uniqsys.com Tue Oct 16 14:57:15 2007 From: carsten at uniqsys.com (Carsten Haese) Date: Tue, 16 Oct 2007 08:57:15 -0400 Subject: [DB-SIG] [ANN] InformixDB-2.5 released Message-ID: <1192539435.3387.1.camel@dot.uniqsys.com> I am pleased to announce a new release of InformixDB, the DB-API 2.0 module for connecting to IBM Informix database engines. A lot has happened in the ten months since the last release: - Compatibility with CSDK 3.00 - Ability to manually interrupt or automatically time out SQL execution - Proper binding of boolean parameters in WHERE clauses - Make version information about server and client available - Various bug fixes Get the goods at http://informixdb.sourceforge.net Best regards, -- Carsten Haese http://informixdb.sourceforge.net From unixdude at gmail.com Wed Oct 17 16:50:53 2007 From: unixdude at gmail.com (Jim Patterson) Date: Wed, 17 Oct 2007 10:50:53 -0400 Subject: [DB-SIG] probleme with cx_oracle In-Reply-To: <4714D9FF.8010101@atmoauvergne.asso.fr> References: <47050ABD.9040603@atmoauvergne.asso.fr> <4709DC8D.6000804@atmoauvergne.asso.fr> <4714D9FF.8010101@atmoauvergne.asso.fr> Message-ID: On 10/16/07, yann FORTIER wrote: > > Thanks Jim > It's wonderful > All is working.................; Fabulous, that is good news. Can you explain me how to inscribe on the mail list on this site To make the mailing list show the messages on the site, all you have to do is CC the mailing list address in your messages. I'll repost the answer I gave you so that future readers can find it. ----------------------------------- Here is a sample script that I have tested on Windows XP running Python 2.4.4 using cx_Oracle 4.3.2 connecting a Unicode installation of Oracle 10G R2: import os # Set the environ before importing os.environ["NLS_LANG"] = ".AL32UTF8" import cx_Oracle cxn = cx_Oracle.connect("scott/tiger") curs = cxn.cursor() # This is just a sample to get some unicode data curs.execute(r"SELECT COMPOSE(UNISTR('a\0303')) FROM dual") row = curs.fetchone() # You actually get back encoded data in an 8-bit string raw_col = row[0] print "Raw string: class=%s, len=%d" % (raw_col.__class__, len(raw_col)) # decode it into something python can use col = raw_col.decode(cxn.encoding) import unicodedata print "Unicode string: class=%s, len=%d, name=%s" % (col.__class__, len(col), unicodedata.name(col,'.')) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20071017/24691ee1/attachment.htm From rschneiderman at yahoo.com Tue Oct 16 23:09:38 2007 From: rschneiderman at yahoo.com (Richard Schneiderman) Date: Tue, 16 Oct 2007 14:09:38 -0700 (PDT) Subject: [DB-SIG] Fwd: Informixdb blob usage Message-ID: <945806.20653.qm@web52408.mail.re2.yahoo.com> --- Richard Schneiderman wrote: > Date: Tue, 16 Oct 2007 13:50:35 -0700 (PDT) > From: Richard Schneiderman > Subject: Informixdb blob usage > To: chaese at users.sourceforge.net > > Mr. Haese, > Thanks for creating Informixdb. It has been very > useful at work. I have a question though. I have not > been able to find a good sample query to update a > blob > field using your library. > > I tried rr = informixdb.Connection.Sblob(conn) but > it > keeps throwing erors. I'm not even sure this is > close. > > Can you send me a working example, so that I can see > what to do? I can update the blobs using ESQL/C but > I > would like to do this in python. > > I did see where the library was recently updated to > version 2.5. I was happy to be able to compile 2.4 > and get it working. > > Sincerely, > Richard Schneiderman > > > > ____________________________________________________________________________________ > Yahoo! oneSearch: Finally, mobile search > that gives answers, not web links. > http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC > ____________________________________________________________________________________ Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting From carsten at uniqsys.com Wed Oct 17 18:47:30 2007 From: carsten at uniqsys.com (Carsten Haese) Date: Wed, 17 Oct 2007 12:47:30 -0400 Subject: [DB-SIG] Fwd: Informixdb blob usage In-Reply-To: <945806.20653.qm@web52408.mail.re2.yahoo.com> References: <945806.20653.qm@web52408.mail.re2.yahoo.com> Message-ID: <1192639650.10116.27.camel@dot.uniqsys.com> On Tue, 2007-10-16 at 14:09 -0700, Richard Schneiderman wrote: > --- Richard Schneiderman > wrote: > > > Date: Tue, 16 Oct 2007 13:50:35 -0700 (PDT) > > From: Richard Schneiderman > > Subject: Informixdb blob usage > > To: chaese at users.sourceforge.net > > > > Mr. Haese, > > Thanks for creating Informixdb. It has been very > > useful at work. I have a question though. I have not > > been able to find a good sample query to update a > > blob > > field using your library. > > > > I tried rr = informixdb.Connection.Sblob(conn) but > > it > > keeps throwing erors. I'm not even sure this is > > close. Oddly enough, it took about 20 hours for this message to appear here on the db-sig list, long after I already answered the question in private email. Now that the question is visible to the public, I'll also answer publicly, for the benefit of any future readers that find this question in an archive. To clarify, the OP is trying to update BYTE/TEXT columns (simple large objects), not BLOB/CLOB (smart large objects). Sblob instances are for updating/inserting contents of Smart Large Object columns. The "S" in Sblob stands for smart, and the "b" stands for "I couldn't bring myself to call it 'Slob'." :) To update/insert BYTE/TEXT columns, you may bind either a string or an informixdb.Binary(...) object to the query: #### import informixdb conn = informixdb.connect("stores_demo") cur = conn.cursor() cur.execute(""" update catalog set cat_descr = ? where catalog_num = ? """, ("This is the new description for catalog number 10001", "10001")) descr10002 = informixdb.Binary("Description for catalog number 10002") cur.execute(""" update catalog set cat_descr = ? where catalog_num = ? """, (descr10002, "10002")) #### Note that the ability to bind strings directly is an InformixDB-specific extension. If you want to stay within the bounds of the DB-API specifications for easier porting between databases, use informixdb.Binary. Hope this helps, -- Carsten Haese http://informixdb.sourceforge.net From carl at personnelware.com Wed Oct 17 20:07:46 2007 From: carl at personnelware.com (Carl Karsten) Date: Wed, 17 Oct 2007 13:07:46 -0500 Subject: [DB-SIG] probleme with cx_oracle In-Reply-To: References: <47050ABD.9040603@atmoauvergne.asso.fr> <4709DC8D.6000804@atmoauvergne.asso.fr> <4714D9FF.8010101@atmoauvergne.asso.fr> Message-ID: <47164F72.60907@personnelware.com> > > Can you explain me how to inscribe on the mail list on this site > > > To make the mailing list show the messages on the site, all you > have to do is CC the mailing list address in your messages. In case the easy way isn't obvious: hit "Reply All" instead of just "Reply." Carl K From szybalski at gmail.com Fri Oct 19 18:44:30 2007 From: szybalski at gmail.com (Lukasz Szybalski) Date: Fri, 19 Oct 2007 11:44:30 -0500 Subject: [DB-SIG] no-error error Message-ID: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> Hello, I have a python program that converts some data and writes it via ODBC driver. I am using a win32 dbi,odbc to do that. (none of the free other ones work) I just upgraded my ODBC driver to a newer version that supposedly is a 2.0 compatible. Now I am getting a: dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC Driver]String or binary data would be truncated in EXEC What I noticed is that dbi.no-error has given me this error. How do I except a 'no-error' error? Lucas -- -- Vim auto completion for python http://lucasmanual.com/mywiki/FrontPage#head-8ce19b13e89893059e126b719bebe4ee32fe103c TurboGears from start to finish: http://www.lucasmanual.com/mywiki/TurboGears From carl at personnelware.com Fri Oct 19 20:02:31 2007 From: carl at personnelware.com (Carl Karsten) Date: Fri, 19 Oct 2007 13:02:31 -0500 Subject: [DB-SIG] no-error error In-Reply-To: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> References: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> Message-ID: <4718F137.3000407@personnelware.com> Lukasz Szybalski wrote: > Hello, > I have a python program that converts some data and writes it via ODBC driver. > I am using a win32 dbi,odbc to do that. (none of the free other ones work) Did you try http://ceodbc.sourceforge.net ? I missed it the first time I went searching for odbc modules. When I tried it, I got an error that according to the driver docs was only applicable to the jdbc driver, which I wasn't using. Turns out the odbc driver had a bug in it, and Anthony (ceODBC author) responded with a workaround (rename my exe to msdev.exe!) within a day, and within a week had a ceODBC update that had a more elegant workaround. (he can't fix bugs in someone elses odbc driver, so workaround is as good as it will get) Carl K From szybalski at gmail.com Fri Oct 19 21:02:16 2007 From: szybalski at gmail.com (Lukasz Szybalski) Date: Fri, 19 Oct 2007 14:02:16 -0500 Subject: [DB-SIG] no-error error In-Reply-To: <4718F137.3000407@personnelware.com> References: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> <4718F137.3000407@personnelware.com> Message-ID: <804e5c70710191202o161d9806x49988ec7a703312f@mail.gmail.com> Have you guys ever deal with this error? dbi.no-error? On 10/19/07, Carl Karsten wrote: > Lukasz Szybalski wrote: > > Hello, > > I have a python program that converts some data and writes it via ODBC driver. > > I am using a win32 dbi,odbc to do that. (none of the free other ones work) > > Did you try http://ceodbc.sourceforge.net ? > > I missed it the first time I went searching for odbc modules. > > When I tried it, I got an error that according to the driver docs was only > applicable to the jdbc driver, which I wasn't using. > > Turns out the odbc driver had a bug in it, and Anthony (ceODBC author) responded > with a workaround (rename my exe to msdev.exe!) within a day, and within a week > had a ceODBC update that had a more elegant workaround. (he can't fix bugs in > someone elses odbc driver, so workaround is as good as it will get) > Quick test to see if it can do a simple thing. >>> c=ceODBC.Connection('DSN=PMS',) >>> d=c.cursor() >>> d.execute('select * from PMSr') Traceback (most recent call last): File "", line 1, in ceODBC.NotSupportedError: Variable_TypeBySqlDataType: unhandled data type 92 >>> I guess datetime field or ulong is not supported. So I guess I will stick to what I have. Thanks for the info do. From mal at egenix.com Fri Oct 19 23:18:58 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 19 Oct 2007 23:18:58 +0200 Subject: [DB-SIG] no-error error In-Reply-To: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> References: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> Message-ID: <47191F42.3060207@egenix.com> Lukasz Szybalski wrote: > Hello, > I have a python program that converts some data and writes it via ODBC driver. > I am using a win32 dbi,odbc to do that. (none of the free other ones work) > > I just upgraded my ODBC driver to a newer version that supposedly is a > 2.0 compatible. > > Now I am getting a: > dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC Driver]String or > binary data would be truncated in EXEC > > What I noticed is that dbi.no-error has given me this error. How do I > except a 'no-error' error? I can't help you with that, but I'd suggest that you try our mxODBC Python ODBC interface. It comes with support for errorhandlers, so you can work around many problems you find with an ODBC driver, such as error reports which really should be handled as warnings or not at all. http://www.egenix.com/products/python/mxODBC/ BTW: Which ODBC driver are you using and against which database backend ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2007) >>> 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,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From David.Lloyd at cis.co.uk Tue Oct 23 17:00:21 2007 From: David.Lloyd at cis.co.uk (David.Lloyd at cis.co.uk) Date: Tue, 23 Oct 2007 16:00:21 +0100 Subject: [DB-SIG] Reading DB2 on AIX in Python scripts Message-ID: Hello, I am new to Python and I am trying to work out if it is possible to use Python to read DB2 version 8/9 tables on an AIX server. The code will reside on the same server as the database. If it is possible, does anyone have any examples of connecting to a DB2 database they could forward to me? Regards Dave Lloyd ************************************************************************* This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return: you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions expressed are those of the individual author. The CIS marketing group, members of which are authorised and regulated by the Financial Services Authority, includes: Co-operative Insurance Society Limited Registered in England number 3615R CIS General Insurance Limited Registered in England number 29999R CIS Unit Managers Limited Registered in England and Wales number 2369965 CIS Policyholder Services Limited Registered in England and Wales number 3390839 Registered offices: Miller Street, Manchester M60 0AL Internet http://www.cis.co.uk CIS & the CIS logo (R) Co-operative Insurance Society Limited ************************************************************************* From haraldarminmassa at gmail.com Tue Oct 23 17:06:15 2007 From: haraldarminmassa at gmail.com (Harald Armin Massa) Date: Tue, 23 Oct 2007 17:06:15 +0200 Subject: [DB-SIG] Reading DB2 on AIX in Python scripts In-Reply-To: References: Message-ID: <7be3f35d0710230806j3ff8fc13x82c1b22f8cf979a1@mail.gmail.com> David, never done that. But a quick google reveals: http://sourceforge.net/projects/pydb2/ there is a python package, called pydb2. So the most propable code will be: import pydb2 cn=pydb2.connect(database="database", host="host", user="user", password="password") cs=cn.cursor() cs.execute("select foo from bar") for row in cs.fetchall(): print row using help (pydb2.connect) you may get some information about the fitting connect-parameters for your database. But I guess you know much more about DB2 than me and will figure that out. (i.e.: with Oracle it is just connect("user","pwd", "instanz") Best wishes, Harald On 10/23/07, David.Lloyd at cis.co.uk wrote: > > Hello, > > I am new to Python and I am trying to work out if it is possible to use > Python to read DB2 version 8/9 tables on an AIX server. The code will > reside on the same server as the database. > > If it is possible, does anyone have any examples of connecting to a DB2 > database they could forward to me? > > Regards > > Dave Lloyd > ************************************************************************* > > This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return: you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions expressed are those of the individual author. > > The CIS marketing group, members of which are authorised and regulated by the Financial Services Authority, includes: > Co-operative Insurance Society Limited Registered in England number 3615R > CIS General Insurance Limited Registered in England number 29999R > CIS Unit Managers Limited Registered in England and Wales number 2369965 > CIS Policyholder Services Limited Registered in England and Wales number 3390839 > > Registered offices: Miller Street, Manchester M60 0AL > Internet http://www.cis.co.uk > > > CIS & the CIS logo (R) Co-operative Insurance Society Limited > > > ************************************************************************* > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Stra?e 49 70435 Stuttgart 0173/9409607 fx 01212-5-13695179 - EuroPython 2008 will take place in Vilnius, Lithuania - Stay tuned! From David.Lloyd at cis.co.uk Tue Oct 23 17:27:31 2007 From: David.Lloyd at cis.co.uk (David.Lloyd at cis.co.uk) Date: Tue, 23 Oct 2007 16:27:31 +0100 Subject: [DB-SIG] Reading DB2 on AIX in Python scripts In-Reply-To: <7be3f35d0710230806j3ff8fc13x82c1b22f8cf979a1@mail.gmail.com> Message-ID: Many thanks for that Harald. I will try that out and have a look at the pydb2 project site. Kind Regards Dave Lloyd "Harald Armin Massa" "David.Lloyd at cis.co.uk" Sent by: db-sig-bounces at py cc thon.org db-sig at python.org Subject Re: [DB-SIG] Reading DB2 on AIX in 23/10/2007 16:06 Python scripts David, never done that. But a quick google reveals: http://sourceforge.net/projects/pydb2/ there is a python package, called pydb2. So the most propable code will be: import pydb2 cn=pydb2.connect(database="database", host="host", user="user", password="password") cs=cn.cursor() cs.execute("select foo from bar") for row in cs.fetchall(): print row using help (pydb2.connect) you may get some information about the fitting connect-parameters for your database. But I guess you know much more about DB2 than me and will figure that out. (i.e.: with Oracle it is just connect("user","pwd", "instanz") Best wishes, Harald On 10/23/07, David.Lloyd at cis.co.uk wrote: > > Hello, > > I am new to Python and I am trying to work out if it is possible to use > Python to read DB2 version 8/9 tables on an AIX server. The code will > reside on the same server as the database. > > If it is possible, does anyone have any examples of connecting to a DB2 > database they could forward to me? > > Regards > > Dave Lloyd > ************************************************************************* > > This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return: you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions expressed are those of the individual author. > > The CIS marketing group, members of which are authorised and regulated by the Financial Services Authority, includes: > Co-operative Insurance Society Limited Registered in England number 3615R > CIS General Insurance Limited Registered in England number 29999R > CIS Unit Managers Limited Registered in England and Wales number 2369965 > CIS Policyholder Services Limited Registered in England and Wales number 3390839 > > Registered offices: Miller Street, Manchester M60 0AL > Internet http://www.cis.co.uk > > > CIS & the CIS logo (R) Co-operative Insurance Society Limited > > > ************************************************************************* > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Stra?e 49 70435 Stuttgart 0173/9409607 fx 01212-5-13695179 - EuroPython 2008 will take place in Vilnius, Lithuania - Stay tuned! _______________________________________________ DB-SIG maillist - DB-SIG at python.org http://mail.python.org/mailman/listinfo/db-sig ************************************************************************* This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return: you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions expressed are those of the individual author. The CIS marketing group, members of which are authorised and regulated by the Financial Services Authority, includes: Co-operative Insurance Society Limited Registered in England number 3615R CIS General Insurance Limited Registered in England number 29999R CIS Unit Managers Limited Registered in England and Wales number 2369965 CIS Policyholder Services Limited Registered in England and Wales number 3390839 Registered offices: Miller Street, Manchester M60 0AL Internet http://www.cis.co.uk CIS & the CIS logo (R) Co-operative Insurance Society Limited ************************************************************************* From jimmy.briggs at gmail.com Wed Oct 24 06:03:00 2007 From: jimmy.briggs at gmail.com (James Briggs) Date: Wed, 24 Oct 2007 14:03:00 +1000 Subject: [DB-SIG] Reading DB2 on AIX in Python scripts In-Reply-To: References: Message-ID: <23b1b67f0710232103j6742da5h7a2b4d8fa4452bd4@mail.gmail.com> Hi, I have been using pyodbc to connect to DB2 on an AS400. Different beast I know but this is successful provided you have the correct ODBC drivers installed for the flavour of DB2 on your PC. An example from my code, which returns a database connection: import pyodbc def connect_to_db2(): """ quick and dirty connect to db2 """ s='DRIVER={iSeries access ODBC Driver};SYSTEM=10.3.36.150;UID=%s;PWD=%s' return connect_to_db(connect_str=s%('myuser','mypassword'),autocommit=True) db=connect_to_db2() c=db.cursor() # # insert working code here # c.close() db.close() I found the autocommit needs to be true for our flavour of DB2, this may not be the case with DB2 on AIX which has proper rollbacks and commits. James On 10/24/07, David.Lloyd at cis.co.uk wrote: > > > Hello, > > I am new to Python and I am trying to work out if it is possible to use > Python to read DB2 version 8/9 tables on an AIX server. The code will > reside on the same server as the database. > > If it is possible, does anyone have any examples of connecting to a DB2 > database they could forward to me? > > Regards > > Dave Lloyd > ************************************************************************* > > This e-mail may contain confidential information or be privileged. It is > intended to be read and used only by the named recipient(s). If you are not > the intended recipient(s) please notify us immediately so that we can make > arrangements for its return: you should not disclose the contents of this > e-mail to any other person, or take any copies. Unless stated otherwise by > an authorised individual, nothing contained in this e-mail is intended to > create binding legal obligations between us and opinions expressed are those > of the individual author. > > The CIS marketing group, members of which are authorised and regulated by > the Financial Services Authority, includes: > Co-operative Insurance Society Limited Registered in England number 3615R > CIS General Insurance Limited Registered in England number 29999R > CIS Unit Managers Limited Registered in England and Wales number 2369965 > CIS Policyholder Services Limited Registered in England and Wales number > 3390839 > > Registered offices: Miller Street, Manchester M60 0AL > Internet http://www.cis.co.uk > > > CIS & the CIS logo (R) Co-operative Insurance Society Limited > > > ************************************************************************* > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20071024/a87b1bde/attachment.htm From mal at egenix.com Wed Oct 24 11:12:06 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 24 Oct 2007 11:12:06 +0200 Subject: [DB-SIG] Reading DB2 on AIX in Python scripts In-Reply-To: <23b1b67f0710232103j6742da5h7a2b4d8fa4452bd4@mail.gmail.com> References: <23b1b67f0710232103j6742da5h7a2b4d8fa4452bd4@mail.gmail.com> Message-ID: <471F0C66.8010203@egenix.com> On 2007-10-24 06:03, James Briggs wrote: > Hi, > > I have been using pyodbc to connect to DB2 on an AS400. > Different beast I know but this is successful provided you have the correct > ODBC drivers installed for the flavour of DB2 on your PC. > > An example from my code, which returns a database connection: > > import pyodbc > > def connect_to_db2(): > """ > quick and dirty connect to db2 > """ > s='DRIVER={iSeries access ODBC Driver};SYSTEM=10.3.36.150;UID=%s;PWD=%s' > return > connect_to_db(connect_str=s%('myuser','mypassword'),autocommit=True) > > db=connect_to_db2() > c=db.cursor() > # > # insert working code here > # > c.close() > db.close() > > I found the autocommit needs to be true for our flavour of DB2, this may not > be the case with DB2 on AIX which has proper rollbacks and commits. Not sure why you would need auto commit to be true. In fact, you only rarely want to *not* use transactions with a database (it's one of the most important features in database programming). You will also want to define a system data source on the machine your running the above code on, instead of passing the driver details to the Windows ODBC Manager directly. This makes your code both more portable and creates fewer issues with Windows permission management. With mxODBC you can connect to a DB2 running on AS400 using this driver for Windows: http://www-03.ibm.com/systems/i/software/access/windows/ Or this driver if you want to connect from Linux: http://www-03.ibm.com/systems/i/software/access/linux/ Both work reliably with transactions and have been in use for many years by quite a few mxODBC users. However, David was looking for a solution that runs on AIX, so all this doesn't really help him :-) Then again, mxODBC works on AIX as well... http://www.egenix.com/products/python/mxODBC/ -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 24 2007) >>> 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,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From carl at personnelware.com Wed Oct 24 15:23:59 2007 From: carl at personnelware.com (Carl Karsten) Date: Wed, 24 Oct 2007 08:23:59 -0500 Subject: [DB-SIG] DSN or not In-Reply-To: <471F0C66.8010203@egenix.com> References: <23b1b67f0710232103j6742da5h7a2b4d8fa4452bd4@mail.gmail.com> <471F0C66.8010203@egenix.com> Message-ID: <471F476F.5060002@personnelware.com> >> An example from my code, which returns a database connection: >> >> import pyodbc >> >> def connect_to_db2(): >> """ >> quick and dirty connect to db2 >> """ >> s='DRIVER={iSeries access ODBC Driver};SYSTEM=10.3.36.150;UID=%s;PWD=%s' >> return >> connect_to_db(connect_str=s%('myuser','mypassword'),autocommit=True) >> >> db=connect_to_db2() >> c=db.cursor() >> # >> # insert working code here >> # >> c.close() >> db.close() >> > > You will also want to define a system data source on the machine > your running the above code on, instead of passing the driver > details to the Windows ODBC Manager directly. This makes your > code both more portable and creates fewer issues with Windows > permission management. I disagree with the "DSN is best" generalization. They both have their places, and it is up to the developer to chose which is best for a given situation. In the case of sample code being posted to a mail list, I think DSNs just confuse things, as where a DSNless connection string makes it clear exactly what options are being set. I will agree that for production code, DSNs have something to offer, but even then there are cases where they aren't needed. Carl K From mal at egenix.com Wed Oct 24 15:54:00 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 24 Oct 2007 15:54:00 +0200 Subject: [DB-SIG] DSN or not In-Reply-To: <471F476F.5060002@personnelware.com> References: <23b1b67f0710232103j6742da5h7a2b4d8fa4452bd4@mail.gmail.com> <471F0C66.8010203@egenix.com> <471F476F.5060002@personnelware.com> Message-ID: <471F4E78.3090602@egenix.com> Carl Karsten wrote: >>> An example from my code, which returns a database connection: >>> >>> import pyodbc >>> >>> def connect_to_db2(): >>> """ >>> quick and dirty connect to db2 >>> """ >>> s='DRIVER={iSeries access ODBC Driver};SYSTEM=10.3.36.150;UID=%s;PWD=%s' >>> return >>> connect_to_db(connect_str=s%('myuser','mypassword'),autocommit=True) >>> >>> db=connect_to_db2() >>> c=db.cursor() >>> # >>> # insert working code here >>> # >>> c.close() >>> db.close() >>> >> You will also want to define a system data source on the machine >> your running the above code on, instead of passing the driver >> details to the Windows ODBC Manager directly. This makes your >> code both more portable and creates fewer issues with Windows >> permission management. > > I disagree with the "DSN is best" generalization. They both have their places, > and it is up to the developer to chose which is best for a given situation. In > the case of sample code being posted to a mail list, I think DSNs just confuse > things, as where a DSNless connection string makes it clear exactly what options > are being set. > > I will agree that for production code, DSNs have something to offer, but even > then there are cases where they aren't needed. I'm happy to agree that we disagree :-) Data source details are part of the system configuration and as such shouldn't be part of application code. Even if you post code as example, the developer will have to install the ODBC driver and it's usually easier to setup a data source using the GUI tools available for the drivers right along with it, than trying to find the right option syntax for the DSN keywords. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 24 2007) >>> 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,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From szybalski at gmail.com Wed Oct 24 21:36:05 2007 From: szybalski at gmail.com (Lukasz Szybalski) Date: Wed, 24 Oct 2007 14:36:05 -0500 Subject: [DB-SIG] [SOLVED]Re: no-error error In-Reply-To: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> References: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> Message-ID: <804e5c70710241236x373a8860m32f2dabd5418cf9d@mail.gmail.com> On 10/19/07, Lukasz Szybalski wrote: > Hello, > I have a python program that converts some data and writes it via ODBC driver. > I am using a win32 dbi,odbc to do that. (none of the free other ones work) > > I just upgraded my ODBC driver to a newer version that supposedly is a > 2.0 compatible. > > Now I am getting a: > dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC Driver]String or > binary data would be truncated in EXEC > This error means that truncation would have to happen, so instead of truncating the data the odbc driver decided to throw an error and exit the program. Are truncation errors suppose to stop the write of data per API 2.0 specifications? I have tried the ceODBC and the new version that will come out will support the TopSpeed ODBC Driver 5.0 for tps data files. Also, as a side not. If you ever come around a "Driver not capable" error you need to set the autocommit=True. c = ceODBC.Connection("DSN=MYDATASOURCE", autocommit = True) > What I noticed is that dbi.no-error has given me this error. How do I > except a 'no-error' error? And if you need to except any errors from database: except ceODBC.DatabaseError, e: print e #do stuff Thanks, Lucas -- -- Vim auto completion for python http://lucasmanual.com/mywiki/FrontPage#head-8ce19b13e89893059e126b719bebe4ee32fe103c TurboGears from start to finish: http://www.lucasmanual.com/mywiki/TurboGears From mal at egenix.com Thu Oct 25 12:58:15 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 25 Oct 2007 12:58:15 +0200 Subject: [DB-SIG] [SOLVED]Re: no-error error In-Reply-To: <804e5c70710241236x373a8860m32f2dabd5418cf9d@mail.gmail.com> References: <804e5c70710190944m51f6cbd6t7bb4eeab09eb9adc@mail.gmail.com> <804e5c70710241236x373a8860m32f2dabd5418cf9d@mail.gmail.com> Message-ID: <472076C7.7030705@egenix.com> On 2007-10-24 21:36, Lukasz Szybalski wrote: > On 10/19/07, Lukasz Szybalski wrote: >> Hello, >> I have a python program that converts some data and writes it via ODBC driver. >> I am using a win32 dbi,odbc to do that. (none of the free other ones work) >> >> I just upgraded my ODBC driver to a newer version that supposedly is a >> 2.0 compatible. >> >> Now I am getting a: >> dbi.no-error: [SoftVelocity Inc.][TopSpeed ODBC Driver]String or >> binary data would be truncated in EXEC >> > This error means that truncation would have to happen, so instead of > truncating the data the odbc driver decided to throw an error and exit > the program. > > Are truncation errors suppose to stop the write of data per API 2.0 > specifications? Well, yes. You hardly want data to be truncated while transferring it from or to the database. > I have tried the ceODBC and the new version that will come out will > support the TopSpeed ODBC Driver 5.0 for tps data files. > > Also, as a side not. If you ever come around a "Driver not capable" > error you need to set the autocommit=True. > > c = ceODBC.Connection("DSN=MYDATASOURCE", autocommit = True) While most file-based ODBC drivers require (re)enabling auto-commit, you should be aware that by doing so, you risk data corruption if you write to the data source and find an error in the processing halfway through. Transaction based programming saves you from this. >> What I noticed is that dbi.no-error has given me this error. How do I >> except a 'no-error' error? > And if you need to except any errors from database: > > except ceODBC.DatabaseError, e: > print e > #do stuff Right. DatabaseError is the base class of all database interface related errors as per the DB-API 2.0. This is true for all DB-API 2.0 compatible database modules. BTW: I wonder why SoftVelocity describes an ODBC driver that "conforms to the ODBC 1 specification with many Level 2 features" as "new": http://www.softvelocity.com/products/database_tsodbc.htm The ODBC standard has already reached version 3.51 many years ago. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 25 2007) >>> 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,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From anthony.tuininga at gmail.com Fri Oct 26 20:11:46 2007 From: anthony.tuininga at gmail.com (Anthony Tuininga) Date: Fri, 26 Oct 2007 12:11:46 -0600 Subject: [DB-SIG] ceODBC 1.2 Message-ID: <703ae56b0710261111kbb5dbc6lfead076f373d6f2c@mail.gmail.com> What is ceODBC? ceODBC is a Python extension module that enables access to databases using the ODBC API and conforms to the Python database API 2.0 specifications with a few additions. I have tested this on Windows against SQL Server, Access, dBASE and Oracle and others have reported success on more obscure drivers. On Linux I have tested this against PostgreSQL. Where do I get it? http://ceodbc.sourceforge.net What's new? 1) Added support for time data as requested by Dmitry Solitsky. 2) Added support for Python 2.4 as requested by Lukasz Szybalski. 3) Added support for setting the autocommit flag in the connection constructor since some drivers do not support transactions and raise a "driver not capable" exception if any attempt is made to turn autocommit off; thanks to Carl Karsten for working with me to resolve this problem. 4) Added support for calculating the size and display size of columns in the description attribute of cursors as requested by Carl Karsten. 5) Use SQLFreeHandle() rather than SQLCloseCursor() since closing a cursor in the ODBC sense is not the same as closing a cursor in the DB API sense and caused strange exceptions to occur if no query was executed before calling cursor.close(). 6) Added additional documentation to README.txt as requested by Lukasz Szybalski. 7) Tweaked setup script and associated configuration files to make it easier to build and distribute; better support for building with cx_Logging if desired. From phd at phd.pp.ru Tue Oct 30 16:28:00 2007 From: phd at phd.pp.ru (Oleg Broytmann) Date: Tue, 30 Oct 2007 18:28:00 +0300 Subject: [DB-SIG] SQLObject 0.8.6 Message-ID: <20071030152800.GG1327@phd.pp.ru> Hello! I'm pleased to announce the 0.8.6 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, and Firebird. It also has newly added support for Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: http://cheeseshop.python.org/pypi/SQLObject/0.8.6 News and changes: http://sqlobject.org/News.html What's New ========== News since 0.8.5 ---------------- Bug Fixes ~~~~~~~~~ * Remove 'limit' from SelectResults after setting start/end so .clone() never sees limit again. * Fixed a bug in sqlbuilder._LikeQuoted() - call sqlrepr() on the expression to escape single quotes if the expression is a string. * Fixed StringCol and UnicodeCol: use sqlType with MSSQL. * Fixed startswith/endswith/contains for UnicodeCol. Other Changes ~~~~~~~~~~~~~ * Removed SelectResults.__nonzero__, which was a design mistake. Raising an exception in __nonzero__() is inconsistent with other iterators (bool(iter([])) => True). * Changed the default value for 'varchar' in BLOBColumns from 'auto' to False (so that the default type for the columns in MySQL is BLOB, not TEXT). * Changed the implementation type in BoolCol under MySQL from TINYINT to BOOL (which is a synonym for TINYINT(1)). For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru Programmers don't die, they just GOSUB without RETURN. From phd at phd.pp.ru Tue Oct 30 16:33:17 2007 From: phd at phd.pp.ru (Oleg Broytmann) Date: Tue, 30 Oct 2007 18:33:17 +0300 Subject: [DB-SIG] SQLObject 0.9.2 Message-ID: <20071030153317.GK1327@phd.pp.ru> Hello! I'm pleased to announce the 0.9.2 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, and Firebird. It also has newly added support for Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: http://cheeseshop.python.org/pypi/SQLObject/0.9.2 News and changes: http://sqlobject.org/News.html What's New ========== News since 0.9.1 ---------------- Bug Fixes ~~~~~~~~~ * Remove 'limit' from SelectResults after setting start/end so .clone() never sees limit again. * Fixed a bug in sqlbuilder._LikeQuoted() - call sqlrepr() on the expression to escape single quotes if the expression is a string. * Fixed a bug in Versioning - do not copy "alternateID" and "unique" attributes from the versioned table. * Fixed a misspelled 'zerofill' option's name. * Fixed StringCol and UnicodeCol: use sqlType with MSSQL. * Fixed startswith/endswith/contains for UnicodeCol. * Fixed bugs in SQLiteConnection.guessColumn(). Other Changes ~~~~~~~~~~~~~ * Removed SelectResults.__nonzero__, which was a design mistake. Raising an exception in __nonzero__() is inconsistent with other iterators (bool(iter([])) => True). * Changed the default value for 'varchar' in BLOBColumns from 'auto' to False (so that the default type for the columns in MySQL is BLOB, not TEXT). * Changed the implementation type in BoolCol under MySQL from TINYINT to BOOL (which is a synonym for TINYINT(1)). For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru Programmers don't die, they just GOSUB without RETURN. From phd at phd.pp.ru Tue Oct 30 16:21:07 2007 From: phd at phd.pp.ru (Oleg Broytmann) Date: Tue, 30 Oct 2007 18:21:07 +0300 Subject: [DB-SIG] SQLObject 0.7.9 Message-ID: <20071030152107.GC1327@phd.pp.ru> Hello! I'm pleased to announce the 0.7.9 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, and Firebird. It also has newly added support for Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: http://cheeseshop.python.org/pypi/SQLObject/0.7.9 News and changes: http://sqlobject.org/docs/News.html What's New ========== News since 0.7.8 ---------------- Bug Fixes ~~~~~~~~~ * Remove 'limit' from SelectResults after setting start/end so .clone() never sees limit again. * Fixed a bug in sqlbuilder._LikeQuoted() - call sqlrepr() on the expression to escape single quotes if the expression is a string. * Fixed StringCol and UnicodeCol: use sqlType with MSSQL. * Fixed startswith/endswith/contains for UnicodeCol. Other Changes ~~~~~~~~~~~~~ * Changed the default value for 'varchar' in BLOBColumns from 'auto' to False (so that the default type for the columns in MySQL is BLOB, not TEXT). * Changed the implementation type in BoolCol under MySQL from TINYINT to BOOL (which is a synonym for TINYINT(1)). For a more complete list, please see the news: http://sqlobject.org/docs/News.html Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru Programmers don't die, they just GOSUB without RETURN.