From info at egenix.com Mon Jul 10 17:45:58 2006 From: info at egenix.com (eGenix Team: M.-A. Lemburg) Date: Mon, 10 Jul 2006 17:45:58 +0200 Subject: [DB-SIG] ANN: eGenix mxODBC Zope Database Adapter 1.0.10 Message-ID: <44B27636.1090805@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 craftereric at hotmail.com Fri Jul 14 20:21:54 2006 From: craftereric at hotmail.com (Eric Crafter) Date: Fri, 14 Jul 2006 18:21:54 +0000 Subject: [DB-SIG] Sybase create table Message-ID: I posed this question to the Python Sybase group and was told to post it here in hopes a getting an answer. I have Sybase syntax like following: create table xxxdelete ( "login" varchar(233) ) Since login is a Sybase reserved word it needs to be in double quotes. I have checked through the Sybase gui that this works. My problem is that I am creating a Python script to do this and I get a syntax error. I can't figure out where I am going wrong. Here is what I did: import Sybase import string db = Sybase.connect('cipherpoc', 'dba', 'SQL') cursor = db.cursor () print ( "CREATE TABLE xxxdelete ( \" login \" varchar(233) )" ) ----> returns CREATE TABLE xxxdelete ( " login " varchar(233) ) If I take the above output and paste into my Sybase gui tool, I have verified that the table gets created successfully. Similarly, the statement print ('''CREATE TABLE xxxdelete ("login" varchar(233) )''') outputs CREATE TABLE xxxdelete ("login" varchar(233) ) which also creates the table successfully. However this statement fails no one can figure out why: cursor.execute ( "CREATE TABLE xxxdelete ( \" login \" varchar(233) )" ) ----> same info as the above print statement ASA Error -131: Syntax error near ' login ' on line 1 Any ideas? _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From anthony.tuininga at gmail.com Fri Jul 21 19:46:57 2006 From: anthony.tuininga at gmail.com (Anthony Tuininga) Date: Fri, 21 Jul 2006 11:46:57 -0600 Subject: [DB-SIG] cx_Oracle 4.2 Message-ID: <703ae56b0607211046m551a1c8al3e2af641906fb9eb@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://starship.python.net/crew/atuining What's new? 1) Added support for parsing an Oracle statement as requested by Patrick Blackwill. 2) Added support for BFILEs at the request of Matthew Cahn. 3) Added support for binding decimal.Decimal objects to cursors. 4) Added support for reading from NCLOBs as requested by Chris Dunscombe. 5) Added connection attributes encoding and nencoding which return the IANA character set name for the character set and national character set in use by the client. 6) Rework module initialization to use the techniques recommended by the Python documentation as one user was experiencing random segfaults due to the use of the module dictionary after the initialization was complete. 7) Removed support for the OPT_Threading attribute. Use the threaded keyword when creating connections and session pools instead. 8) Removed support for the OPT_NumbersAsStrings attribute. Use the numbersAsStrings attribute on cursors instead. 9) Use type long rather than type int in order to support long integers on 64-bit machines as reported by Uwe Hoffmann. 10) Add cursor attribute "bindarraysize" which is defaulted to 1 and is used to determine the size of the arrays created for bind variables. 11) Added repr() methods to provide something a little more useful than the standard type name and memory address. 12) Added keyword argument support to the functions that imply such in the documentation as requested by Harald Armin Massa. 13) Treat an empty dictionary passed through to cursor.execute() as keyword arguments the same as if no keyword arguments were specified at all, as requested by Fabien Grumelard. 14) Fixed memory leak when a LOB read would fail. 15) Set the LDFLAGS value in the environment rather than directly in the setup.py file in order to satisfy those who wish to enable the use of debugging symbols. 16) Use __DATE__ and __TIME__ to determine the date and time of the build rather than passing it through directly. 17) Use Oracle types and add casts to reduce warnings as requested by Amaury Forgeot d'Arc. 18) Fixed typo in error message. From anthony.tuininga at gmail.com Mon Jul 24 19:19:45 2006 From: anthony.tuininga at gmail.com (Anthony Tuininga) Date: Mon, 24 Jul 2006 11:19:45 -0600 Subject: [DB-SIG] cx_OracleTools 7.4 Message-ID: <703ae56b0607241019o6120f587i95eefd10e5031e73@mail.gmail.com> What is cx_OracleDBATools? cx_OracleTools is a set of Python scripts that handle Oracle database development tasks in a cross platform manner and improve (in my opinion) on the tools that are available by default in an Oracle client installation. Those who use cx_Oracle (a Python interface driver for Oracle compatible with the DB API) may also be interested in this project, if only as examples. Binaries are provided for those who do not have a Python installation. Where do I get it? http://starship.python.net/crew/atuining What's new? 1) Use cx_Logging to output messages rather than write directly to stderr. 2) Added support for describing comments on tables and columns. 3) Improved output when an exception occurs. 4) cx_Oracle 4.2 is now required. 5) Replace use of executemanyprepared() with executemany() and bind arrays instead of dictionaries which actually improves performance by about 20-25% in some cases. 6) Moved code from module cx_DumpData in project cx_PyOracleLib into DumpData. 7) Provide more meaningful message when source or target directory is missing in GeneratePatch as requested by Micah Friesen. 8) Ignore invalid objects of type "UNDEFINED" when describing objects. 9) Export the roles before the users as the reason the roles are included is because they are administered by the users and the grants will by definition fail. 10) In ExportObjects, create the directory before any exporting actually takes place in order to handle the situation when no objects are exported as requested by Micah Friesen. 11) Eliminated identical grants made by different users when describing objects. 12) Add phrase "(n% of file)" to the reporting message of ImportData when possible as requested by Don Reid. 13) Display something more reasonable when compiling statements that modify constraints. From anthony.tuininga at gmail.com Mon Jul 24 21:28:07 2006 From: anthony.tuininga at gmail.com (Anthony Tuininga) Date: Mon, 24 Jul 2006 13:28:07 -0600 Subject: [DB-SIG] cx_OracleDBATools 2.2 Message-ID: <703ae56b0607241228oad150a6saa2332c29b2ce950@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://starship.python.net/crew/atuining What's new? 1) Added option --replace-existing to CloneDB in order to support issuing one command to replace an existing database with a copy of another one. 2) Always set the enviroment, even when connecting directly using cx_Oracle, as otherwise the wrong SID could be set and the wrong action take place. 3) Do not prompt for the value for ORACLE_HOME if the --no-prompts option has been invoked. 4) Increase the size of the template system tablespace for Oracle 10g as it was too small. 5) On Windows, wait until the service is actually started or stopped before continuing. From ioboe at hotmail.com Sun Jul 30 07:49:16 2006 From: ioboe at hotmail.com (Kiwi Golf) Date: Sun, 30 Jul 2006 01:49:16 -0400 Subject: [DB-SIG] Question about MySQL insert function Message-ID: Dear all, Following is the example code I tried. I got a problem that the table is created however the data can not insert into MySQL server. Any idea how to fix this? Thank you very much! Chloe -------------------------------------------- import sys import MySQLdb # connect to the MySQL server try: conn = MySQLdb.connect (host = "localhost", user = "root", passwd = "1234", db = "animal") except MySQLdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) sys.exit (1) # create the animal table and populate it try: cursor = conn.cursor () cursor.execute ("DROP TABLE IF EXISTS animal1") cursor.execute (""" CREATE TABLE animal1 ( name CHAR(40), category CHAR(40) ) """) cursor.execute (""" INSERT INTO animal1 (name, category) VALUES ('snake', 'reptile'), ('frog', 'amphibian'), ('tuna', 'fish'), ('racoon', 'mammal') """) print "%d rows were inserted" % cursor.rowcount cursor.close () except MySQLdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) sys.exit (1) conn.close () sys.exit (0) _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From andy47 at halfcooked.com Sun Jul 30 11:18:06 2006 From: andy47 at halfcooked.com (Andy Todd) Date: Sun, 30 Jul 2006 19:18:06 +1000 Subject: [DB-SIG] Question about MySQL insert function In-Reply-To: References: Message-ID: <44CC794E.9040004@halfcooked.com> Kiwi Golf wrote: > Dear all, > > Following is the example code I tried. I got a problem that the table is > created however the data can not insert into MySQL server. Any idea how to > fix this? > > Thank you very much! > Chloe > -------------------------------------------- > import sys > import MySQLdb > > # connect to the MySQL server > try: > conn = MySQLdb.connect (host = "localhost", > user = "root", > passwd = "1234", > db = "animal") > except MySQLdb.Error, e: > print "Error %d: %s" % (e.args[0], e.args[1]) > sys.exit (1) > > # create the animal table and populate it > try: > cursor = conn.cursor () > cursor.execute ("DROP TABLE IF EXISTS animal1") > cursor.execute (""" > CREATE TABLE animal1 > ( > name CHAR(40), > category CHAR(40) > ) > """) > > cursor.execute (""" > INSERT INTO animal1 (name, category) > VALUES > ('snake', 'reptile'), > ('frog', 'amphibian'), > ('tuna', 'fish'), > ('racoon', 'mammal') > """) > print "%d rows were inserted" % cursor.rowcount > > cursor.close () > > except MySQLdb.Error, e: > print "Error %d: %s" % (e.args[0], e.args[1]) > sys.exit (1) > > conn.close () > sys.exit (0) > Do you see any error messages when you run this code? What output do you get from your print statements? As far as I can tell there isn't anything wrong with your SQL statements, they run OK in an interactive session against my database (Python 2.3, MySQLdb 1.2.0 and MySQL 5.0.18). When you say that the data can't be inserted is that because you have some feedback indicating that or because you do a subsequent query and return no rows. Just a couple of pointers; - don't connect to your database as root, it's generally a bad idea - don't wrap your entire transaction in a try .. except block, especially one that just catches every database error. If you want to deal with specific exceptions then trap them on or around the statement they are likely to be raised by. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ From andy47 at halfcooked.com Sun Jul 30 23:28:26 2006 From: andy47 at halfcooked.com (Andy Todd) Date: Mon, 31 Jul 2006 07:28:26 +1000 Subject: [DB-SIG] Question about MySQL insert function In-Reply-To: References: Message-ID: <44CD247A.4080902@halfcooked.com> Kiwi Golf wrote: > Hi Andy, > > I run the code (.py) without any error message however when I go back to > MySQL server, and try to check whether the data was inserted into MySQL, > I got empty set from the db. My system is Python 2.4, MySQL 5.0, and > MySQLdb(MySQL-python.exe-1.2.1_p2.win32-py2.4.exe) running under window XP. > > Thanks again for your help. > Chloe > [snip] Well if you aren't seeing any messages but aren't getting the result you expect I'd call that an error. Get rid of the try/except clauses in your code - or just run each statement in an interactive interpreter - and if you still can't figure out what's going on paste the commands and results in a message to the list. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ From ccurvey at gmail.com Mon Jul 31 00:36:19 2006 From: ccurvey at gmail.com (Chris Curvey) Date: Sun, 30 Jul 2006 18:36:19 -0400 Subject: [DB-SIG] Question about MySQL insert function In-Reply-To: References: Message-ID: <25ef693e0607301536o20b04e18td10da3e828454a35@mail.gmail.com> Just wondering...do you need to commit() ? On 7/30/06, Kiwi Golf wrote: > > Dear all, > > Following is the example code I tried. I got a problem that the table is > created however the data can not insert into MySQL server. Any idea how to > fix this? > > Thank you very much! > Chloe > -------------------------------------------- > import sys > import MySQLdb > > # connect to the MySQL server > try: > conn = MySQLdb.connect (host = "localhost", > user = "root", > passwd = "1234", > db = "animal") > except MySQLdb.Error, e: > print "Error %d: %s" % (e.args[0], e.args[1]) > sys.exit (1) > > # create the animal table and populate it > try: > cursor = conn.cursor () > cursor.execute ("DROP TABLE IF EXISTS animal1") > cursor.execute (""" > CREATE TABLE animal1 > ( > name CHAR(40), > category CHAR(40) > ) > """) > > cursor.execute (""" > INSERT INTO animal1 (name, category) > VALUES > ('snake', 'reptile'), > ('frog', 'amphibian'), > ('tuna', 'fish'), > ('racoon', 'mammal') > """) > print "%d rows were inserted" % cursor.rowcount > > cursor.close () > > except MySQLdb.Error, e: > print "Error %d: %s" % (e.args[0], e.args[1]) > sys.exit (1) > > conn.close () > sys.exit (0) > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > -- The short answer is "Yes." The long answer is "No." -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20060730/f67ca37f/attachment.htm