From aaltepet at bethel.edu Thu Mar 1 13:24:19 2012 From: aaltepet at bethel.edu (Andrew Altepeter) Date: Thu Mar 1 20:24:25 2012 Subject: [egenix-users] egenix zopeda 2.0.2 and execute parameters Message-ID: Greetings, I recently upgraded to egenix mxodbc zopeda 2.0.2. Our zope environment is zope 2.12.20 and python 2.6.7, 32-bit RHEL 5 (or opensuse 12.1), unixodbc 2.2.12 and oracle instantclient 10.2.0.5 (installed via rpm) We have some python code which gets an 'eGenix mxODBC Database Connection' (the zope object), then gets a connection object via get_connection(). With the connection object, we can call the 'execute' method, and pass in parameters, e.g. to select rows in table `table` where `column` matches 'A': conn = db.get_connection() conn.execute('select * from table where column=?', ('A',)) In zopeda 2.2, this always returns an empty rowset. If I rewrite the query to be: conn.execute("select * from table where column='A' ") Then it works. Another query, like: conn.execute('insert into table (W,X,Y,Z) values(?,?,?,?)', ('A','B','C','D')) raises the following error: 2012-02-28 16:02:36,198 INFO [root] eGenix mxODBC Zope DA: received an OperationalError ('HY000', 12899, '[unixODBC][Oracle][ODBC][Ora]ORA-12899: value too large for column "schema"."table"."X" (actual: 4, maximum: 1)\n', 8396); trying to reconnect and replay transaction If I revert back to zopeda 2.0.1 the first query, using a params list, works (and of course the second query works too). It seems like zopeda2.0.2 isn't passing the parameters down to the odbc level correctly. The error above seems to indicate that the full params list is being passed to the first '?' param. Thanks, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20120301/9023d429/attachment.htm From mal at egenix.com Fri Mar 2 16:05:02 2012 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 2 16:05:11 2012 Subject: [egenix-users] egenix zopeda 2.0.2 and execute parameters In-Reply-To: References: Message-ID: <4F50E19E.1010403@egenix.com> Andrew Altepeter wrote: > Greetings, > > I recently upgraded to egenix mxodbc zopeda 2.0.2. Our zope environment is > zope 2.12.20 and python 2.6.7, 32-bit RHEL 5 (or opensuse 12.1), unixodbc > 2.2.12 and oracle instantclient 10.2.0.5 (installed via rpm) > > We have some python code which gets an 'eGenix mxODBC Database Connection' > (the zope object), then gets a connection object via get_connection(). > > With the connection object, we can call the 'execute' method, and pass in > parameters, e.g. to select rows in table `table` where `column` matches 'A': > > conn = db.get_connection() > conn.execute('select * from table where column=?', ('A',)) > > In zopeda 2.2, this always returns an empty rowset. > > If I rewrite the query to be: > conn.execute("select * from table where column='A' ") > Then it works. > > Another query, like: > conn.execute('insert into table (W,X,Y,Z) values(?,?,?,?)', > ('A','B','C','D')) > raises the following error: > 2012-02-28 16:02:36,198 INFO [root] eGenix mxODBC Zope DA: > -1258087568/-1258087568 at 0xc3d83cc> received an OperationalError > ('HY000', 12899, '[unixODBC][Oracle][ODBC][Ora]ORA-12899: value too large > for column "schema"."table"."X" (actual: 4, maximum: 1)\n', 8396); trying > to reconnect and replay transaction > > If I revert back to zopeda 2.0.1 the first query, using a params list, > works (and of course the second query works too). > > It seems like zopeda2.0.2 isn't passing the parameters down to the odbc > level correctly. The error above seems to indicate that the full params > list is being passed to the first '?' param. We checked this using the following external method, but cannot reproduce the problem: test_execute.py: ---------------- # # External Method Module test_execute # def test(self, request=None, form=None): """ Test conn.execute() with parameters. Uses the Zope object "oracle" (an eGenix mxODBC Zope DA Connection object) which must be accessible in the current context. """ conn = self.oracle.get_connection() try: conn.execute('drop table test_zopeda') except conn.DatabasePackage.ProgrammingError: pass conn.execute('create table test_zopeda ' '(id int, col1 varchar(10), col2 varchar(10))') conn.execute('insert into test_zopeda values (?,?,?)', (1, 'a', 'd')) conn.execute('insert into test_zopeda values (?,?,?)', (2, 'abc', 'def')) rs = conn.execute('select * from test_zopeda where col1=?', ('abc',)) conn.execute('drop table test_zopeda') print 'Results:', rs return 'Works. See log for results.' This gives: Results: ([{'width': 38, 'null': 1, 'type': 'i', 'name': 'ID'}, {'width': 10, 'null': 1, 'type': 's', 'name': 'COL1'}, {'width': 10, 'null': 1, 'type': 's', 'name': 'COL2'}], [(2, 'abc', 'def')]) in the log. Note that mxODBC Zope DA was compiled against unixODBC 2.3.0. Version 2.2.12 is not supported anymore, since it uses a different SQLLEN parameter type in its APIs. Could you recheck with unixODBC 2.3.0 ? Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Mar 02 2012) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2012-02-13: Released eGenix pyOpenSSL 0.13 http://egenix.com/go26 2012-02-09: Released mxODBC.Zope.DA 2.0.2 http://egenix.com/go25 2012-02-06: Released eGenix mx Base 3.2.3 http://egenix.com/go24 ::: Try our new mxODBC.Connect Python Database Interface 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 http://www.egenix.com/company/contact/ From aaltepet at bethel.edu Fri Mar 2 10:28:48 2012 From: aaltepet at bethel.edu (Andrew Altepeter) Date: Fri Mar 2 17:28:54 2012 Subject: [egenix-users] egenix zopeda 2.0.2 and execute parameters In-Reply-To: <4F50E19E.1010403@egenix.com> References: <4F50E19E.1010403@egenix.com> Message-ID: Hello, Thank you for your quick response. I forgot that 2.0.2 was compiled against unixodbc 2.3.0. That's the problem. Thanks, Andy On Fri, Mar 2, 2012 at 9:05 AM, M.-A. Lemburg wrote: > Andrew Altepeter wrote: > > Greetings, > > > > I recently upgraded to egenix mxodbc zopeda 2.0.2. Our zope environment > is > > zope 2.12.20 and python 2.6.7, 32-bit RHEL 5 (or opensuse 12.1), unixodbc > > 2.2.12 and oracle instantclient 10.2.0.5 (installed via rpm) > > > > We have some python code which gets an 'eGenix mxODBC Database > Connection' > > (the zope object), then gets a connection object via get_connection(). > > > > With the connection object, we can call the 'execute' method, and pass in > > parameters, e.g. to select rows in table `table` where `column` matches > 'A': > > > > conn = db.get_connection() > > conn.execute('select * from table where column=?', ('A',)) > > > > In zopeda 2.2, this always returns an empty rowset. > > > > If I rewrite the query to be: > > conn.execute("select * from table where column='A' ") > > Then it works. > > > > Another query, like: > > conn.execute('insert into table (W,X,Y,Z) values(?,?,?,?)', > > ('A','B','C','D')) > > raises the following error: > > 2012-02-28 16:02:36,198 INFO [root] eGenix mxODBC Zope DA: > > > -1258087568/-1258087568 at 0xc3d83cc> received an OperationalError > > ('HY000', 12899, '[unixODBC][Oracle][ODBC][Ora]ORA-12899: value too large > > for column "schema"."table"."X" (actual: 4, maximum: 1)\n', 8396); trying > > to reconnect and replay transaction > > > > If I revert back to zopeda 2.0.1 the first query, using a params list, > > works (and of course the second query works too). > > > > It seems like zopeda2.0.2 isn't passing the parameters down to the odbc > > level correctly. The error above seems to indicate that the full params > > list is being passed to the first '?' param. > > We checked this using the following external method, but > cannot reproduce the problem: > > test_execute.py: > ---------------- > # > # External Method Module test_execute > # > def test(self, request=None, form=None): > > """ Test conn.execute() with parameters. > > Uses the Zope object "oracle" (an eGenix mxODBC Zope DA Connection > object) which must be accessible in the current context. > > """ > conn = self.oracle.get_connection() > try: > conn.execute('drop table test_zopeda') > except conn.DatabasePackage.ProgrammingError: > pass > conn.execute('create table test_zopeda ' > '(id int, col1 varchar(10), col2 varchar(10))') > conn.execute('insert into test_zopeda values (?,?,?)', > (1, 'a', 'd')) > conn.execute('insert into test_zopeda values (?,?,?)', > (2, 'abc', 'def')) > rs = conn.execute('select * from test_zopeda where col1=?', ('abc',)) > conn.execute('drop table test_zopeda') > print 'Results:', rs > return 'Works. See log for results.' > > This gives: > > Results: ([{'width': 38, 'null': 1, 'type': 'i', 'name': 'ID'}, {'width': > 10, 'null': 1, 'type': > 's', 'name': 'COL1'}, {'width': 10, 'null': 1, 'type': 's', 'name': > 'COL2'}], [(2, 'abc', 'def')]) > > in the log. > > Note that mxODBC Zope DA was compiled against unixODBC 2.3.0. > Version 2.2.12 is not supported anymore, since it uses a > different SQLLEN parameter type in its APIs. > > Could you recheck with unixODBC 2.3.0 ? > > Thanks, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Mar 02 2012) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > 2012-02-13: Released eGenix pyOpenSSL 0.13 http://egenix.com/go26 > 2012-02-09: Released mxODBC.Zope.DA 2.0.2 http://egenix.com/go25 > 2012-02-06: Released eGenix mx Base 3.2.3 http://egenix.com/go24 > > ::: Try our new mxODBC.Connect Python Database Interface 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 > http://www.egenix.com/company/contact/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20120302/9f4dd5bf/attachment.htm From info at egenix.com Mon Mar 5 23:11:14 2012 From: info at egenix.com (eGenix Team: M.-A. Lemburg) Date: Mon Mar 5 23:15:04 2012 Subject: [egenix-users] ANN: Python Meeting =?iso-8859-1?q?D=FCsseldorf_-_03=2E04=2E2012?= Message-ID: <4F553A02.4030005@egenix.com> [This announcement is in German since it targets a local user group meeting in D?sseldorf, Germany] ________________________________________________________________________ ANK?NDIGUNG Python Meeting D?sseldorf Ein Treffen von Python Enthusiasten und Interessierten in ungezwungener Atmosph?re. Dienstag, 03.04.2012, 18:00 Uhr Clara Schumann Raum DJH D?sseldorf http://python-meeting-duesseldorf.de/ Diese Nachricht k?nnen Sie auch online lesen: http://www.egenix.com/company/news/Python-Meeting-Duesseldorf-2012-04-03 ________________________________________________________________________ EINLEITUNG Das Python Meeting D?sseldorf ist eine neue lokale Veranstaltung in D?sseldorf, die sich an Python Begeisterte in der Region wendet. Wir starten bei den Treffen mit einer kurzen Einleitung und gehen dann zu einer Reihe Kurzvortr?gen (Lightning Talks) ?ber, bei denen die Anwesenden ?ber neue Projekte, interessante Probleme und sonstige Aktivit?ten rund um Python berichten k?nnen. Anschlie?end geht es in eine Gastst?tte, um die Gespr?che zu vertiefen. Veranstaltet wird das Meeting von der eGenix.com GmbH, Langenfeld, in Zusammenarbeit mit Clark Consulting & Research, D?sseldorf: * http://www.egenix.com/ * http://www.clark-consulting.eu/ ________________________________________________________________________ ORT F?r das Python Meeting D?sseldorf haben wir den Clara Schumann Raum in der modernen Jugendherberge D?sseldorf angemietet: Jugendherberge D?sseldorf D?sseldorfer Str. 1 40545 D?sseldorf Telefon: +49 211 557310 http://www.duesseldorf.jugendherberge.de Die Jugendherberge verf?gt ?ber eine kostenpflichtige Tiefgarage (EUR 2,50 pro Stunde, maximal EUR 10,00). Es ist aber auch m?glich per Bus und Bahn anzureisen. Der Raum befindet sich im 1.OG links. ________________________________________________________________________ PROGRAMM Das Python Meeting D?sseldorf nutzt eine Mischung aus Open Space und Lightning Talks: Die Treffen starten mit einer kurzen Einleitung. Danach geht es weiter mit einer Lightning Talk Session, in der die Anwesenden Kurzvortr?ge von f?nf Minuten halten k?nnen. Hieraus ergeben sich dann meisten viele Ansatzpunkte f?r Diskussionen, die dann den Rest der verf?gbaren Zeit in Anspruch nehmen k?nnen. F?r 19:45 Uhr haben wir in einem nahegelegenen Restaurant Pl?tze reserviert, damit auch das leibliche Wohl nicht zu kurz kommt. Lightning Talks k?nnen vorher angemeldet werden, oder auch spontan w?hrend des Treffens eingebracht werden. Ein Beamer mit XGA Aufl?sung steht zur Verf?gung. Folien bitte als PDF auf USB Stick mitbringen. Lightning Talk Anmeldung bitte formlos per EMail an info@pyddf.de ________________________________________________________________________ KOSTENBETEILIGUNG Das Python Meeting D?sseldorf wird von Python Nutzern f?r Python Nutzer veranstaltet. Da Tagungsraum, Beamer, Internet und Getr?nke Kosten produzieren, bitten wir die Teilnehmer um einen Beitrag in H?he von EUR 10,00 inkl. 19% Mwst. Wir m?chten alle Teilnehmer bitten, den Betrag in bar mitzubringen. ________________________________________________________________________ ANMELDUNG Da wir nur f?r ca. 20 Personen Sitzpl?tze haben, m?chten wir bitten, sich per EMail anzumelden. Damit wird keine Verpflichtung eingegangen. Es erleichtert uns allerdings die Planung. Meeting Anmeldung bitte formlos per EMail an info@pyddf.de ________________________________________________________________________ WEITERE INFORMATIONEN Weitere Informationen finden Sie auf der Webseite des Meetings: http://python-meeting-duesseldorf.de/ Mit freundlichen Gr??en, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Mar 05 2012) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2012-02-13: Released eGenix pyOpenSSL 0.13 http://egenix.com/go26 2012-02-09: Released mxODBC.Zope.DA 2.0.2 http://egenix.com/go25 2012-02-06: Released eGenix mx Base 3.2.3 http://egenix.com/go24 ::: Try our new mxODBC.Connect Python Database Interface 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 http://www.egenix.com/company/contact/