From 06jgwrxuk at hotmail.com Sat May 1 15:43:29 2004 From: 06jgwrxuk at hotmail.com (Sylvester Wills) Date: Sat May 1 20:44:11 2004 Subject: [DB-SIG] RE: I saw your profile Message-ID: Hey my name is Kara and I just got out of a long term relationship. I read your profile and you sound like the kind of man I am looking for. Just so you know I am not really looking for anything serious but rather for someone who doesn't mind being a rebound, which by the way does require some hot physical action... so if you don't mind... http://www.hereformore.com/alg/lgs.htm no more http://www.hereformore.com/alg/o/ From anthony at interlink.com.au Sun May 2 23:58:32 2004 From: anthony at interlink.com.au (Anthony Baxter) Date: Sun May 2 23:59:04 2004 Subject: [DB-SIG] cx_Oracle Oracle 10g on Linux In-Reply-To: <408FDB1A.8090107@halfcooked.com> References: <408FDB1A.8090107@halfcooked.com> Message-ID: <4095C368.5070306@interlink.com.au> Andy Todd wrote: > Hi all, > > I've just installed Oracle 10g on my Debian box and am now trying to > talk to it from Python. > > I've downloaded and installed cx_Oracle 4.0.1 but when I try and import > the module I get an error; > > """ > Python 2.3.3 (#2, Feb 24 2004, 09:29:20) > [GCC 3.3.3 (Debian)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import cx_Oracle > Traceback (most recent call last): > File "", line 1, in ? > ImportError: libclntsh.so.10.1: cannot open shared object file: No such > file or directory > >>> > """ > > For the record, Oracle 10g does have a libclntsh.so (in $ORACLE_HOME/lib) > > I note that Anthony says that the code works on Linux > (http://aspn.activestate.com/ASPN/Mail/Message/db-sig/2011613) so I'm > presuming I am missing some configuration. Does anyone have any > suggestions? Is your Oracle environment set up correctly? Do you have $ORACLE_HOME, and is $ORACLE_HOME/lib in your ld.so search path? From andy47 at halfcooked.com Mon May 3 14:32:32 2004 From: andy47 at halfcooked.com (Andy Todd) Date: Mon May 3 14:32:43 2004 Subject: [DB-SIG] cx_Oracle Oracle 10g on Linux In-Reply-To: <4095C368.5070306@interlink.com.au> References: <408FDB1A.8090107@halfcooked.com> <4095C368.5070306@interlink.com.au> Message-ID: <40969040.6020302@halfcooked.com> Anthony Baxter wrote: > Andy Todd wrote: > >> Hi all, >> >> I've just installed Oracle 10g on my Debian box and am now trying to >> talk to it from Python. >> >> I've downloaded and installed cx_Oracle 4.0.1 but when I try and >> import the module I get an error; >> >> """ >> Python 2.3.3 (#2, Feb 24 2004, 09:29:20) >> [GCC 3.3.3 (Debian)] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import cx_Oracle >> Traceback (most recent call last): >> File "", line 1, in ? >> ImportError: libclntsh.so.10.1: cannot open shared object file: No >> such file or directory >> >>> >> """ >> >> For the record, Oracle 10g does have a libclntsh.so (in $ORACLE_HOME/lib) >> >> I note that Anthony says that the code works on Linux >> (http://aspn.activestate.com/ASPN/Mail/Message/db-sig/2011613) so I'm >> presuming I am missing some configuration. Does anyone have any >> suggestions? > > > Is your Oracle environment set up correctly? Do you have $ORACLE_HOME, > and is $ORACLE_HOME/lib in your ld.so search path? That was indeed the problem. As I said in my last message I had to define LD_LIBRARY_PATH and make sure it contained $ORACLE_HOME/lib Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ From rivier at lsce.saclay.cea.fr Wed May 5 13:03:57 2004 From: rivier at lsce.saclay.cea.fr (Rivier Leonard) Date: Wed May 5 13:07:11 2004 Subject: [DB-SIG] Python vs JAVA with MySQL database Message-ID: <40991E7D.4070902@lsce.saclay.cea.fr> Hello, I would like to use Python with a MySQL database. I know it is possible and tested the API a bit. However when I ask around me in my lab, everybody suggests JAVA to work with MySQL. I am a bit unconfortable pushing Python which I just started learning. Is there a specific document comparing JAVA and Python in their use toward a MySQL database ? Thank you very much Leo From jagerrit at cableone.net Wed May 5 13:19:52 2004 From: jagerrit at cableone.net (Jeff Gerritsen) Date: Wed May 5 13:20:05 2004 Subject: [DB-SIG] Python vs JAVA with MySQL database In-Reply-To: <40991E7D.4070902@lsce.saclay.cea.fr> References: <40991E7D.4070902@lsce.saclay.cea.fr> Message-ID: <1083777592.3756.15.camel@linuxw1> Leo, although this link does not specifically compare java and python to MySql, it does compare the language specifics. http://www.ferg.org/projects/python_java_side-by-side.html On the issue of MySql, and I don't want to start a holy war here, have you look a Postgresql instead? Jeff On Wed, 2004-05-05 at 11:03, Rivier Leonard wrote: > Hello, > > I would like to use Python with a MySQL database. I know it is possible > and tested the API > a bit. However when I ask around me in my lab, everybody suggests JAVA > to work with MySQL. > > I am a bit unconfortable pushing Python which I just started learning. > Is there a specific document > comparing JAVA and Python in their use toward a MySQL database ? > > Thank you very much > Leo > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From rkimble at iceweb.com Wed May 5 13:41:38 2004 From: rkimble at iceweb.com (Bob Kimble) Date: Wed May 5 13:41:57 2004 Subject: [DB-SIG] Python vs JAVA with MySQL database In-Reply-To: <40991E7D.4070902@lsce.saclay.cea.fr> References: <40991E7D.4070902@lsce.saclay.cea.fr> Message-ID: <200405051341.38335.rkimble@iceweb.com> On Wednesday 05 May 2004 01:03 pm, Rivier Leonard wrote: > Hello, > > I would like to use Python with a MySQL database. I know it is possible > and tested the API > a bit. However when I ask around me in my lab, everybody suggests JAVA > to work with MySQL. > > I am a bit unconfortable pushing Python which I just started learning. > Is there a specific document > comparing JAVA and Python in their use toward a MySQL database ? I don't know of any specific documents, but writing Java to work with a SQL database is generally much more code intensive than writing equivalent stuff in Python. Additionally, because of the edit/compile/run cycle inherent in a Java program, it takes a lot longer to prototype something in Java. It also generally takes longer to run a Java version because of the startup time of the JVM -- unless you're working with a LOT of data, in which case the Java version may be faster. I do a lot of database work with both languages. I use Python scripts to generate the bean classes we use to connect to the database using Java. Personally, I suggest using both languages: Java where you need the speed of compiled code, and Python where you need the speed of implementation, or where you're prototyping. I find the two languages work very nicely together. > Thank you very much > Leo > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From askh140 at yahoo.com Thu May 6 07:57:27 2004 From: askh140 at yahoo.com (Ahmad Salman Khan) Date: Thu May 6 07:57:32 2004 Subject: [DB-SIG] Table Oriented Programming Message-ID: <20040506115727.46704.qmail@web41511.mail.yahoo.com> Dear Sir, i am working on Table Oriented Programming(TOP).We are trying to implement TOP features in C #(C sharp). Have you any idea that how can we implement TOP in C #. If not C# then have you implemented it in any other language.If the answer is YES then how? Finally , there is very limited material available about TOP on internet.I can find infornation only at the following web site. http://www.geocities.com/tablizer/top.htm Please tell me that if there is any other web site which provides solid information about TOP. Thanks. Salman --------------------------------- Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040506/d4baa157/attachment.html From wnvcole at peppermillcas.com Thu May 6 11:38:55 2004 From: wnvcole at peppermillcas.com (Vernon Cole) Date: Thu May 6 11:39:01 2004 Subject: [DB-SIG] Table Oriented Programming Message-ID: <07AF3C77A0FBD311A99F00508B65203903272C37@sebastian.peppermillcas.com> Dear Salman & group: I have been involved in table oriented programming off and on for many years. I found that the author of the "tablizer" web page had some VERY good observations. (Too bad he didn't sign it so I could give credit by name.) Table oriented programming has been around for a long time, and is a mighty useful tool. But I was never aware that it had made it into use as a TLA. We in the information technology world are very fond of our TLAs , and anything which is not a TLA or XMLA is really never considered as proper fodder for learning and discussion. Now that we can refer to "table oriented programming" as TOP, maybe it will catch on as it should. [ Note: TLA means "Three Letter Acronym". XMLA is "eXtended Multi-Letter Acronym. These terms were invented by myself to point out our tendency to make everything into an acronym, thereby converting our speech into something only distantly related to English. Someday I intend to write a paper on the subject.] The package I have used most is called RDM (which was at one time a TLA for "Relational Data Manager", but now is just a combination of letters.) RDM was original written in Pascal, is now mostly in C and/or C++, and is heading back in the direction of Delphi. I have thought that Python would be a fine way of accessing RDM data tables, as the two things "feel" very similar in use. Much of my frustration with the python db api "standard" comes from the fact that the api is so much harder to use than RDM. I am itching to add an RDM api to python. If I were to choose an ideal language in which to perform table oriented programming, python would win by a mile. As to your actual question, I have not seen any publications about table oriented programming for several years. Bruce Johnson, to whom I am also addressing this, is the guru of RDM. Perhaps he has seen or produced something recently. [Bruce: are you listening?] -------------------- [Vernon Cole] -----Original Message----- From: Ahmad Salman Khan [mailto:askh140@yahoo.com] Sent: Thursday, May 06, 2004 5:57 AM To: db-sig@python.org Subject: [DB-SIG] Table Oriented Programming Dear Sir, i am working on Table Oriented Programming(TOP).We are trying to implement TOP features in C #(C sharp). Have you any idea that how can we implement TOP in C #. If not C# then have you implemented it in any other language.If the answer is YES then how? Finally , there is very limited material available about TOP on internet.I can find infornation only at the following web site. http://www.geocities.com/tablizer/top.htm Please tell me that if there is any other web site which provides solid information about TOP. Thanks. Salman _____ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040506/ac4852c5/attachment.html From DangeloPage168 at smapxsmap.net Fri May 7 14:54:51 2004 From: DangeloPage168 at smapxsmap.net (Narciso Napper) Date: Fri May 7 15:47:55 2004 Subject: [DB-SIG] Re: I owe you one Message-ID: <200405071800.i47I0sbe051947@mxzilla3.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040508/c771e620/attachment.html From ioawrlauneef at yahoo.com Mon May 10 17:58:55 2004 From: ioawrlauneef at yahoo.com (Travis Staples) Date: Tue May 11 00:21:05 2004 Subject: [DB-SIG] RE: I saw your profile Message-ID: Message [DSASZNHQRQ] Hey my name is Kara and I just got out of a long term relationship. I read your profile and you sound like the kind of man I am looking for. Just so you know I am not really looking for anything serious but rather for someone who doesn’t mind being a rebound, which by the way does require some hot physical action... so if you don’t mind... http://matchnoid.com/alg/lgs.htm no more http://matchnoid.com/alg/o/ easy drug able bedlam upstair deterrent crayon medallion fasten goldsmith avoidance scapula taiwan benight blew mortgage cackle boggy buzz perturb chiefdom bronx landlord From sorr at rightnow.com Thu May 13 19:53:17 2004 From: sorr at rightnow.com (Orr, Steve) Date: Thu May 13 19:53:24 2004 Subject: [DB-SIG] cx_Oracle CLOB.read() fails with cursor.fetchmany() Message-ID: When I do a fetchmany (or fetchall) on a table where some of the CLOB columns are empty it doesn't get CLOB data on non-empty CLOBs. Example: ---------------------------------------------- osql = 'select clobcol from clobtable' ocurs.execute(osql) rows = ocurs.fetchmany(10000) for row in rows: try:print "CLOB value:\n%s\n"%row[0].read() except: print "CLOB value:\n%s\n"%'None' ---------------------------------------------- However if I just fetch one row at a time it works properly. Example: ---------------------------------------------- ocurs.execute(osql) row = ocurs.fetchone() while row: try:print "CLOB value:\n%s\n"%row[0].read() except: print "CLOB value:\n%s\n"%'None' try:row=ocurs.next() except StopIteration:break ---------------------------------------------- Is this a bug? Is there a good way to use CLOB.read() in conjuction with fetchmany? Enhancement request if not. :-) Steve Orr From qnqqz at yahoo.com Sat May 15 20:11:19 2004 From: qnqqz at yahoo.com (Maxwell Currie) Date: Sun May 16 00:36:40 2004 Subject: [DB-SIG] RE: Do you feel life sucks? Message-ID: Message [EEZWCPCHPA] Do you feel depressed lately? Do you have ideas that repeatedly come into mind? do you suffer from sleep problems? Do you have difficulties to think clearly? Do you suffer from lack of pleasure and happiness in your life? Do you feel life sucks? If you have answered yes to at least one of the above questions, Prozac can help you. Buy safe generic prozac online - NO need for doctor's prescription... CLICK ON THIS LINK OR COPY AND PAST THIS WEB ADRESS (URL) TO YOUR BROWSER: http://007meds.net/pr/index.php?pid=evaph0077 contribute orbital sterno strata concertina poi marque contravene whalen innumerable moroccan mcdonald transportation crt From suzu at news.com Mon May 17 18:42:50 2004 From: suzu at news.com (Mazama F. Gibbered) Date: Sun May 16 19:02:54 2004 Subject: [DB-SIG] Have a nice day! //mother of harlots have made herself once more drunk with Message-ID: <110101c43b97$54479f5e$53d99fcc@news.com> Get easy money! http://members.lycos.co.uk/lancer131/1/ --- one with another; Justice saying to God, seeing Justice had From fqmbfkrokk at msn.com Sun May 16 12:11:19 2004 From: fqmbfkrokk at msn.com (Jame Berg) Date: Sun May 16 19:55:32 2004 Subject: [DB-SIG] Best deal of the month Message-ID: <200405161516.i4GFGusU092023@mxzilla8.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040516/7b492a93/attachment.html From BDULON at sqli.com Tue May 18 10:31:32 2004 From: BDULON at sqli.com (Benjamin DULON) Date: Tue May 18 10:44:38 2004 Subject: [DB-SIG]DCOracle2 rounded floats Message-ID: <192353F2A074154C82068805541676F255794B@mailhost.sqli.com> Hello, I'm newbie in DCO2 and python, and I encounter an issue. In Oracle8i, I try to get Number data type. From SQLPlus, no problem, but using dco2, floats are rounded. Instead of having 0.975 I get 1.0 My code : Conn = DCOracle2.connect(connect_string) C = conn.cursor() c.execute('select * from t_sqli where id=4') r = c.fetchall() print entry It returns : [4.0,'QUATRE','d',3.0] It should be : [4,'QUATRE','d',3.1414155225] Trying directly in using sqlplus : no problem. The environnement is Python2.2, DCO2, RedHat9, Oracle8.1.7 Thanks a lot. Benjamin DULON. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040518/aabc3ae7/attachment.html From waechter at cenix-bioscience.com Tue May 18 11:15:26 2004 From: waechter at cenix-bioscience.com (Thomas Waechter) Date: Tue May 18 11:15:33 2004 Subject: [DB-SIG] mxODBC: Function sequence error Message-ID: <5396218.1084893326871.SLOX.WebMail.wwwrun@exon.cenix-bioscience.com> Hallo, I am trying out concurrent read access on an Access ODBC datasource using mxODBC. Basically I am only trying to execute "select * from table where id = 1" statements using several threads. Everything is working fine with just one thread, but using multiple threads curses the following error in MS ODBC Driver Manager . DB driver message: ('S1010', 0, '[Microsoft][ODBC Driver Manager] Function sequence error', 3326)(){} For me it seems that the sequential order of SQLPrepare and SQLExecute calls gets changed in some way. I checked the C++ sources of mxODBC and found out that in the Windows/mxODBC.cpp threads a generally allowed, see as follows: Py_BEGIN_ALLOW_THREADS; rc = SQLPrepare(dbcs->hstmt, (SQLCHAR*)sqlcmd, sqlcmd_len); Py_END_ALLOW_THREADS; ... Py_BEGIN_ALLOW_THREADS; if (!direct) rc = SQLExecute(dbcs->hstmt); else rc = SQLExecDirect(dbcs->hstmt, (SQLCHAR*)PyString_AS_STRING(sqlcmd), (SQLINTEGER)PyString_GET_SIZE(sqlcmd)); Py_END_ALLOW_THREADS; I couldn't find a connection between these two calls. How is it possible to guarantee the right order? My question is now, if it would be sufficient to recompile mxODBC with direct=1 to use SQLExecDirect instead of SQLExecute/Prepare to get rid of this problem or maybe there is another reason for it. Any information regarding this would be greatly appreciated. Thanks for your help in advance. Thomas Waechter -- Thomas Waechter Software Developer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 0155 e-mail : waechter@cenix-bioscience.com Cenix Website : http://www.cenix-bioscience.com From mal at egenix.com Tue May 18 11:40:30 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue May 18 11:40:35 2004 Subject: [DB-SIG] mxODBC: Function sequence error In-Reply-To: <5396218.1084893326871.SLOX.WebMail.wwwrun@exon.cenix-bioscience.com> References: <5396218.1084893326871.SLOX.WebMail.wwwrun@exon.cenix-bioscience.com> Message-ID: <40AA2E6E.4030006@egenix.com> Thomas Waechter wrote: > Hallo, > I am trying out concurrent read access on an Access ODBC datasource using mxODBC. Basically I am only trying to execute "select * from table where id = 1" statements using several threads. Everything is working fine with just one thread, but using multiple threads curses the following error in MS ODBC Driver Manager . > > DB driver message: > ('S1010', 0, '[Microsoft][ODBC Driver Manager] Function sequence error', 3326)(){} Are you using one connection per thread ? Please also make sure that you're using the latest available ODBC drivers for MS Access, since earlier versions are not thread safe. > For me it seems that the sequential order of SQLPrepare and SQLExecute calls gets changed in some way. I checked the C++ sources of mxODBC and found out that in the Windows/mxODBC.cpp threads a generally allowed, see as follows: > > Py_BEGIN_ALLOW_THREADS; > rc = SQLPrepare(dbcs->hstmt, > (SQLCHAR*)sqlcmd, > sqlcmd_len); > Py_END_ALLOW_THREADS; > > ... > > Py_BEGIN_ALLOW_THREADS; > if (!direct) > rc = SQLExecute(dbcs->hstmt); > else > rc = SQLExecDirect(dbcs->hstmt, > (SQLCHAR*)PyString_AS_STRING(sqlcmd), > (SQLINTEGER)PyString_GET_SIZE(sqlcmd)); > Py_END_ALLOW_THREADS; > > I couldn't find a connection between these two calls. How is it possible to guarantee the right order? > My question is now, if it would be sufficient to recompile mxODBC with direct=1 to use SQLExecDirect instead of SQLExecute/Prepare to get rid of this problem or maybe there is another reason for it. > Any information regarding this would be greatly appreciated. No need to recompile: direct is set to 1 if you execute an SQL statement without parameters or you switch to .executedirect(). > Thanks for your help in advance. > Thomas Waechter > > -- > Thomas Waechter > Software Developer > Cenix BioScience > BioInnovations Zentrum > Tatzberg 46 > D-01307 > Dresden > Germany > > Tel : +49 (0)351 4173 0155 > e-mail : waechter@cenix-bioscience.com > Cenix Website : http://www.cenix-bioscience.com > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 18 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2004, G?teborg, Sweden 19 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From randall at tnr.cc Wed May 19 22:46:30 2004 From: randall at tnr.cc (Randall Smith) Date: Wed May 19 22:46:36 2004 Subject: [DB-SIG] pure python database driver Message-ID: <40AC1C06.3090207@tnr.cc> Does anyone know of existing database drivers written in pure Python? I realize this may not perform well, but I'm curious. The portability would be nice. Randall Smith From fog at initd.org Thu May 20 06:12:50 2004 From: fog at initd.org (Federico Di Gregorio) Date: Thu May 20 06:13:47 2004 Subject: [DB-SIG] pure python database driver In-Reply-To: <40AC1C06.3090207@tnr.cc> References: <40AC1C06.3090207@tnr.cc> Message-ID: <1085047969.2667.2.camel@localhost> L? mercoled?, 2004/05/19 alle 21:46, -0500, Randall Smith ha scritto: > Does anyone know of existing database drivers written in pure Python? I > realize this may not perform well, but I'm curious. The portability > would be nice. that would mean reimplementing all the client/server protocol, that changes for *every database*. why port thousands lines of C code to python (for each database) when the original client libraries are already there (and well-tested?) moreover the portability simply would *not* be. as i said above every database uses its won protocol. federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org We are all dust, Saqi, so play the lute We are all wind, Saqi, so bring wine. -- Omar Khayam -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata Url : http://mail.python.org/pipermail/db-sig/attachments/20040520/5fdfa40f/attachment.bin From randall at tnr.cc Thu May 20 09:49:59 2004 From: randall at tnr.cc (Randall Smith) Date: Thu May 20 09:50:04 2004 Subject: [DB-SIG] pure python database driver In-Reply-To: <1085047969.2667.2.camel@localhost> References: <40AC1C06.3090207@tnr.cc> <1085047969.2667.2.camel@localhost> Message-ID: <40ACB787.6030506@tnr.cc> The same reason the Java type 4 jdbc drivers exist. What I mean by portability is that it will work on nearly any machine without dependency issues. Just drop the driver into your app. I've been wanting this ever since I started working with Oracle. I hate having to install the Oracle client libraries just to talk to the database. Installing Oracle on GNU/Linux has given me heartache many times. I don't know if one could write a Python only driver for Oracle because of proprietary issues. Does Oracle release specs for their protocol? Although I don't like programming in Java, one thing I do admire is that applications are often Pure-Java and I try to make my Python applications as Pure-Python as possible. I think one should only write in C when performance is poor. You have confirmed what I believed to be true; The reason these JDBC type 4 like drivers do not exist is that nobody sees enough benefit to justify the work. Randall Federico Di Gregorio wrote: > L? mercoled?, 2004/05/19 alle 21:46, -0500, Randall Smith ha scritto: > >>Does anyone know of existing database drivers written in pure Python? I >>realize this may not perform well, but I'm curious. The portability >>would be nice. > > > that would mean reimplementing all the client/server protocol, that > changes for *every database*. why port thousands lines of C code to > python (for each database) when the original client libraries are > already there (and well-tested?) > > moreover the portability simply would *not* be. as i said above every > database uses its won protocol. > > federico > > > > ------------------------------------------------------------------------ > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From anthony at computronix.com Thu May 20 10:04:43 2004 From: anthony at computronix.com (Anthony Tuininga) Date: Thu May 20 10:04:49 2004 Subject: [DB-SIG] pure python database driver In-Reply-To: <40ACB787.6030506@tnr.cc> References: <40AC1C06.3090207@tnr.cc> <1085047969.2667.2.camel@localhost> <40ACB787.6030506@tnr.cc> Message-ID: <40ACBAFB.6040908@computronix.com> Oracle requires the Oracle client libraries. Period. I haven't heard of anyone providing their own independent drivers for accessing Oracle (unless you count ODBC and friends). Oracle has provided an "instant client" with 10g which is significantly pared down and much easier to install -- I haven't played with it much but if you want simple, that's the way to go. As far as "pure" Python goes, I guess it depends on how far you want to go. The ctypes module (for example) gives you access to routines written in shared libraries in C without having to write C code. Of course, the ctypes module is written in C.... :-) And the difference in performance can be quite significant so I think that C definitely has its place and the realm of database drivers is one of them. :-) Randall Smith wrote: > The same reason the Java type 4 jdbc drivers exist. What I mean by > portability is that it will work on nearly any machine without > dependency issues. Just drop the driver into your app. I've been > wanting this ever since I started working with Oracle. I hate having to > install the Oracle client libraries just to talk to the database. > Installing Oracle on GNU/Linux has given me heartache many times. I > don't know if one could write a Python only driver for Oracle because of > proprietary issues. Does Oracle release specs for their protocol? > > Although I don't like programming in Java, one thing I do admire is that > applications are often Pure-Java and I try to make my Python > applications as Pure-Python as possible. I think one should only write > in C when performance is poor. > > You have confirmed what I believed to be true; The reason these JDBC > type 4 like drivers do not exist is that nobody sees enough benefit to > justify the work. > > Randall > > Federico Di Gregorio wrote: > >> L? mercoled?, 2004/05/19 alle 21:46, -0500, Randall Smith ha scritto: >> >>> Does anyone know of existing database drivers written in pure >>> Python? I realize this may not perform well, but I'm curious. The >>> portability would be nice. >> >> >> >> that would mean reimplementing all the client/server protocol, that >> changes for *every database*. why port thousands lines of C code to >> python (for each database) when the original client libraries are >> already there (and well-tested?) >> >> moreover the portability simply would *not* be. as i said above every >> database uses its won protocol. >> >> federico >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> DB-SIG maillist - DB-SIG@python.org >> http://mail.python.org/mailman/listinfo/db-sig > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From greg at thinksql.co.uk Thu May 20 17:53:03 2004 From: greg at thinksql.co.uk (Greg Gaughan) Date: Thu May 20 17:47:25 2004 Subject: [DB-SIG] pure python database driver References: <40AC1C06.3090207@tnr.cc> Message-ID: <003201c43eb4$d4582b80$107b7b7b@FARADAY> There is a 100% pure Python DB-API driver for the ThinkSQL RDBMS (http://www.thinksql.co.uk). The driver is a single module (and the server is a single executable). The performance is better than using a extra layer of library code. Regards, Greg Gaughan www.thinksql.co.uk ----- Original Message ----- From: "Randall Smith" To: "Python DB-SIG Mailing List" Sent: Thursday, May 20, 2004 3:46 AM Subject: [DB-SIG] pure python database driver > Does anyone know of existing database drivers written in pure Python? I > realize this may not perform well, but I'm curious. The portability > would be nice. > > Randall Smith > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig > From jim-hill at users.sourceforge.net Sun May 23 01:01:55 2004 From: jim-hill at users.sourceforge.net (Jim Hill) Date: Sun May 23 01:02:00 2004 Subject: [DB-SIG] pyPgSQL on MacOS 9 ? Message-ID: Can pyPgSQL, or any other Python db adaptor, run on MacOS 8.6 to 9.x ? Most db adaptors have some C code, as mentioned in the previous thread "pure python database driver", so i guess it boils down to compiling the C code. Can this be done on pre-X Mac ? (I'm not too familiar with mac, just have a customer with some G4s on OS9.) wxPython looks like it would be great for cross-platform gui front ends, but it's not so good if the not-so-old Macs can't talk to the db server. Documentation of most db adaptors does not mention Mac clients before X. They don't say you can't use older MacOSs, they just never mention them. Did not find anything in several mailing lists either. i'm not a very experienced programmer, so please advise if i'm missing something :) Jim Hill From BDULON at sqli.com Mon May 24 04:59:45 2004 From: BDULON at sqli.com (Benjamin DULON) Date: Mon May 24 05:12:44 2004 Subject: [DB-SIG]DCOracle2 rounded floats Message-ID: <192353F2A074154C82068805541676F2557952@mailhost.sqli.com> Hi, I haven't got any response, nobody has encountered this problem ? I think I need to recompile DCO2, but I can't get any information about configurations' options. It seems that it returns float type as default. DCO2 is installed under RedHat 9. Any help will be appreciated. Thanks, Benjamin DULON. Hello, I'm newbie in DCO2 and python, and I encounter an issue. In Oracle8i, I try to get Number data type. From SQLPlus, no problem, but using dco2, floats are rounded. Instead of having 0.975 I get 1.0 My code : Conn = DCOracle2.connect(connect_string) C = conn.cursor() c.execute('select * from t_sqli where id=4') r = c.fetchall() print entry It returns : [4.0,'QUATRE','d',3.0] It should be : [4,'QUATRE','d',3.1414155225] Trying directly in using sqlplus : no problem. The environnement is Python2.2, DCO2, RedHat9, Oracle8.1.7 Thanks a lot. Benjamin DULON. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040524/e2641212/attachment.html From waechter at cenix-bioscience.com Mon May 24 09:12:15 2004 From: waechter at cenix-bioscience.com (Thomas Waechter) Date: Mon May 24 09:12:21 2004 Subject: [DB-SIG] mxODBC: Function sequence error Message-ID: <40B1F4AF.2030106@cenix-bioscience.com> M.-A. Lemburg wrote: > Are you using one connection per thread ? In our framework, on each connection operate several cursors normally having their own thread. So each thread only workes on one connection but there can be more threads per connection. > Please also make sure that you're using the latest available > ODBC drivers for MS Access, since earlier versions are not > thread safe. think so. I am using Microsoft Access Driver 4.00.6019.00. I installed MDAC 2.8 and Jet 4.0 Service Pack 8 (SP8). These should be the newest available versions. But still the same problem occurs. I mutually excluded all my calls to mxODBC to literally serialize them. I expected it to run slow, but the threads shouldn't be able to interfere anymore. But still it crashes with the same "function sequence error" and works if I only allow one thread to be used. > No need to recompile: direct is set to 1 if you execute > an SQL statement without parameters or you switch to > .executedirect(). At the moment, I haven't got a clue how to work out where the problem might be located. Though I encapsulated all calls to mxODBC with exclusive locks, I cannot understand how this error can occur. Which additional information will the debug option of mxODBC provide? Is it worth to try it to find out more about the "function sequence error"? Thanks Thomas -- Thomas Waechter Software Developer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 0155 e-mail : waechter@cenix-bioscience.com Cenix Website : http://www.cenix-bioscience.com From Chris.Hornberger at blackrock.com Mon May 24 09:18:00 2004 From: Chris.Hornberger at blackrock.com (Hornberger, Chris) Date: Mon May 24 09:18:23 2004 Subject: [DB-SIG] mxODBC: Function sequence error Message-ID: What about, rather than handing out cursors to threads, you stacked/queued your requests, and have a centralized db manager? That way you only have to lock the queue object during pop/push actions, and part of the "job" object you stack up can have a call back thru' which you return the results. -------------------------- Chris Hornberger Blackrock - 302.797.2318 chris.hornberger@blackrock.com Card carrying MSDN member since 2004. No, really. I've got the card to prove it. -----Original Message----- From: db-sig-bounces@python.org [mailto:db-sig-bounces@python.org]On Behalf Of Thomas Waechter Sent: Monday, May 24, 2004 9:12 AM To: db-sig@python.org Cc: mal@egenix.com Subject: Re: [DB-SIG] mxODBC: Function sequence error M.-A. Lemburg wrote: > Are you using one connection per thread ? In our framework, on each connection operate several cursors normally having their own thread. So each thread only workes on one connection but there can be more threads per connection. > Please also make sure that you're using the latest available > ODBC drivers for MS Access, since earlier versions are not > thread safe. think so. I am using Microsoft Access Driver 4.00.6019.00. I installed MDAC 2.8 and Jet 4.0 Service Pack 8 (SP8). These should be the newest available versions. But still the same problem occurs. I mutually excluded all my calls to mxODBC to literally serialize them. I expected it to run slow, but the threads shouldn't be able to interfere anymore. But still it crashes with the same "function sequence error" and works if I only allow one thread to be used. > No need to recompile: direct is set to 1 if you execute > an SQL statement without parameters or you switch to > .executedirect(). At the moment, I haven't got a clue how to work out where the problem might be located. Though I encapsulated all calls to mxODBC with exclusive locks, I cannot understand how this error can occur. Which additional information will the debug option of mxODBC provide? Is it worth to try it to find out more about the "function sequence error"? Thanks Thomas -- Thomas Waechter Software Developer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 0155 e-mail : waechter@cenix-bioscience.com Cenix Website : http://www.cenix-bioscience.com _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig From waechter at cenix-bioscience.com Mon May 24 09:55:12 2004 From: waechter at cenix-bioscience.com (Thomas Waechter) Date: Mon May 24 09:55:17 2004 Subject: [DB-SIG] mxODBC: Function sequence error In-Reply-To: References: Message-ID: <40B1FEC0.9050202@cenix-bioscience.com> Hornberger, Chris wrote: > What about, rather than handing out cursors to threads, you > sacked/queued your requests, and have a centralized db > manager? That way you only have to lock the queue object > during pop/push actions, and part of the "job" object you stack up > can have a call back thru' which you return the results. I am working with a general database adapter which only gets specialized for the different data sources. Mostly we are using Postgres, but now I trying to write a specialization for ODBC 2.0 compliant data sources to access a Filemaker database using mxODBC. I am using Access only as my testing platform, because it is better supported. Therefore I don't want to have a central manager, because the database driver in the lower level will call the database for me. Psycopg is doing this for Postgres and mxODBC is doing this work for ODBC data sources. Because there occurred errors due to concurrent read access I emulated the stack in making all calls to mxODBC mutual exclusive. For mxODBC now all calls are coming in sequence, in the same way, as there would be a central manager. Unfortunately I still get the same "function sequence error" from the MS Windows ODBC manager for my Access ODBC Driver. Cheers Thomas -- Thomas Waechter Software Developer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 0155 e-mail : waechter@cenix-bioscience.com Cenix Website : http://www.cenix-bioscience.com From mal at egenix.com Mon May 24 10:49:39 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon May 24 10:50:50 2004 Subject: [DB-SIG] mxODBC: Function sequence error In-Reply-To: <40B1F4AF.2030106@cenix-bioscience.com> References: <40B1F4AF.2030106@cenix-bioscience.com> Message-ID: <40B20B83.4070705@egenix.com> Thomas Waechter wrote: > M.-A. Lemburg wrote: > > Are you using one connection per thread ? > In our framework, on each connection operate several cursors normally > having their own thread. So each thread only workes on one connection > but there can be more threads per connection. > > > Please also make sure that you're using the latest available > > ODBC drivers for MS Access, since earlier versions are not > > thread safe. > think so. I am using Microsoft Access Driver 4.00.6019.00. I installed > MDAC 2.8 and Jet 4.0 Service Pack 8 (SP8). These should be the newest > available versions. > > But still the same problem occurs. I mutually excluded all my calls to > mxODBC to literally serialize them. I expected it to run slow, but the > threads shouldn't be able to interfere anymore. But still it crashes > with the same "function sequence error" and works if I only allow one > thread to be used. > > > > No need to recompile: direct is set to 1 if you execute > > an SQL statement without parameters or you switch to > > .executedirect(). > At the moment, I haven't got a clue how to work out where the problem > might be located. Though I encapsulated all calls to mxODBC with > exclusive locks, I cannot understand how this error can occur. > > Which additional information will the debug option of mxODBC provide? Is > it worth to try it to find out more about the "function sequence error"? Try to compile a version of mxODBC with debugging enabled python setup.py mx_autoconf --enable-debug install If you then run Python in debug mode (python -d), mxODBC will write an mxODBC.log file with lots and lots of details about what is happening. You can also turn on ODBC level logging in the ODBC manager to get even more information. Note that you should avoid mixing connections and cursors with multiple threads if you are working with flaky or buggy ODBC drivers. Ideally, each thread should have one connection and all cursors (there can be more than one per connection) should execute within that thread. The reason is that even though the ODBC standard make thread safety mandatory, a few drivers out there are not 100% thread-safe. Surprisingly, the MS Access one is one of them. I'd also suggest to look into using the MSDE 2000 instead of MS Access: that's basically MS SQL Server 2000 without the GUIs and gives you a much more robust database backend. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 24 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2004, G?teborg, Sweden 13 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From BDULON at sqli.com Tue May 25 06:28:56 2004 From: BDULON at sqli.com (Benjamin DULON) Date: Tue May 25 06:42:23 2004 Subject: [DB-SIG]3rd Post : rounded values returned by DCO2 Message-ID: <192353F2A074154C82068805541676F255795A@mailhost.sqli.com> Hello, I'm in trouble ! I can't understand what happening. I retrieve data from Oracle 8i database, throw DCO2 using python, and I get every values rounded to the nearest integer with a precision of one : 3,97 --> 4.0 4 --> 4.0 4.12 --> 4.0 Please help me I have already send 2 emails to [DB-SIG] mailing list with no success ... I don't know what I can do now ... Operating System : Linux Distribution : Red Hat 9 Python Version : 2.2.1 Oracle Version : 8.1.7 DCO2 : 1.2 Find attached DCO2TRACELOG file. Thanks a lot for any help. Benjamin DULON. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040525/0c3bf561/attachment.html From guido at python.org Tue May 25 10:24:35 2004 From: guido at python.org (Guido van Rossum) Date: Tue May 25 10:24:41 2004 Subject: [DB-SIG]3rd Post : rounded values returned by DCO2 In-Reply-To: Your message of "Tue, 25 May 2004 12:28:56 +0200." <192353F2A074154C82068805541676F255795A@mailhost.sqli.com> References: <192353F2A074154C82068805541676F255795A@mailhost.sqli.com> Message-ID: <200405251424.i4PEOZh02849@guido.python.org> > I'm in trouble ! I can't understand what happening. I retrieve data > from Oracle 8i database, throw DCO2 using python, and I get every > values rounded to the nearest integer with a precision of one : 3,97 > --> 4.0 4 --> 4.0 > 4.12 --> 4.0 > > Please help me I have already send 2 emails to [DB-SIG] mailing list > with no success ... I don't know what I can do now ... > > Operating System : Linux > Distribution : Red Hat 9 > Python Version : 2.2.1 > Oracle Version : 8.1.7 > DCO2 : 1.2 > > Find attached DCO2TRACELOG file. The attachment didn't make it. What we would need to help you, though, is (a) the schema (table definition) and (b) the Python code you are using. Without these nobody can help you. --Guido van Rossum (home page: http://www.python.org/~guido/) From BDULON at sqli.com Tue May 25 10:44:54 2004 From: BDULON at sqli.com (Benjamin DULON) Date: Tue May 25 11:00:47 2004 Subject: [DB-SIG]3rd Post : rounded values returned by DCO2 Message-ID: <192353F2A074154C82068805541676F2557960@mailhost.sqli.com> PYTHON CODE : def Test(): sRetour = '' try: db = DCOracle2.connect(connect_string) c = db.cursor() strSQL = "SELECT DISTINCT VALEUR/2 FROM VM_SQLI_DONNEES WHERE NUMZONE='86160'" c.execute(strSQL); r = c.fetchall() sRetour = '' for entry in r: if entry[0] != None: sRetour += 'VALEUR=%s;@' % (entry[0]) else: pass except (DCOracle2.DatabaseError, TypeError), e: sRetour = 'Erreur execution requete SQL:' + str(e) db.close() return sRetour CODE RETURNS : VALEUR=6.0;@VALEUR=1127.0;@VALEUR=1189.0;@ CODE SHOULD RETURN : VALEUR=6.92;@VALEUR=1127.0;@VALEUR=1189.5;@ If I change SQL request as " SELECT DISTINCT VALEUR FROM VM_SQLI_DONNEES WHERE NUMZONE='86160'" (VALEUR is not divided) then it returns : VALEUR=13.84;@VALEUR=2254;@VALEUR=2379;@ TABLE DEFINITION : VALEUR VARVHAR2(255) With sqlplus, I have no problem. Thanks. Benjamin DULON. > I'm in trouble ! I can't understand what happening. I retrieve data > from Oracle 8i database, throw DCO2 using python, and I get every > values rounded to the nearest integer with a precision of one : 3,97 > --> 4.0 4 --> 4.0 > 4.12 --> 4.0 > > Please help me I have already send 2 emails to [DB-SIG] mailing list > with no success ... I don't know what I can do now ... > > Operating System : Linux > Distribution : Red Hat 9 > Python Version : 2.2.1 > Oracle Version : 8.1.7 > DCO2 : 1.2 > > Find attached DCO2TRACELOG file. The attachment didn't make it. What we would need to help you, though, is (a) the schema (table definition) and (b) the Python code you are using. Without these nobody can help you. --Guido van Rossum (home page: http://www.python.org/~guido/) From peter at monicol.co.uk Tue May 25 11:15:51 2004 From: peter at monicol.co.uk (Peter Mott) Date: Tue May 25 11:16:12 2004 Subject: [DB-SIG]3rd Post : rounded values returned by DCO2 In-Reply-To: <192353F2A074154C82068805541676F2557960@mailhost.sqli.com> References: <192353F2A074154C82068805541676F2557960@mailhost.sqli.com> Message-ID: <6.0.1.1.2.20040525161521.01d5dec0@pop3.monicol.co.uk> SELECT DISTINCT VALEUR/2 Does it truncate with VALEUR instead of VALEUR/2? Peter At 15:44 25/05/2004, Benjamin DULON wrote: >PYTHON CODE : > >def Test(): > > > sRetour = '' > try: > db = DCOracle2.connect(connect_string) > c = db.cursor() > strSQL = "SELECT DISTINCT VALEUR/2 FROM VM_SQLI_DONNEES WHERE >NUMZONE='86160'" > > > c.execute(strSQL); > > > r = c.fetchall() > sRetour = '' > for entry in r: > if entry[0] != None: > sRetour += 'VALEUR=%s;@' % (entry[0]) > > > else: pass > > > except (DCOracle2.DatabaseError, TypeError), e: > sRetour = 'Erreur execution requete SQL:' + str(e) > > > db.close() > return sRetour > >CODE RETURNS : > VALEUR=6.0;@VALEUR=1127.0;@VALEUR=1189.0;@ > >CODE SHOULD RETURN : > VALEUR=6.92;@VALEUR=1127.0;@VALEUR=1189.5;@ > >If I change SQL request as " SELECT DISTINCT VALEUR FROM VM_SQLI_DONNEES >WHERE NUMZONE='86160'" (VALEUR is not divided) then it returns : > VALEUR=13.84;@VALEUR=2254;@VALEUR=2379;@ > >TABLE DEFINITION : > VALEUR VARVHAR2(255) > >With sqlplus, I have no problem. > >Thanks. > >Benjamin DULON. > > > I'm in trouble ! I can't understand what happening. I retrieve data > > from Oracle 8i database, throw DCO2 using python, and I get every > > values rounded to the nearest integer with a precision of one : 3,97 > > --> 4.0 4 --> 4.0 > > 4.12 --> 4.0 > > > > Please help me I have already send 2 emails to [DB-SIG] mailing list > > with no success ... I don't know what I can do now ... > > > > Operating System : Linux > > Distribution : Red Hat 9 > > Python Version : 2.2.1 > > Oracle Version : 8.1.7 > > DCO2 : 1.2 > > > > Find attached DCO2TRACELOG file. > >The attachment didn't make it. > >What we would need to help you, though, is (a) the schema (table >definition) and (b) the Python code you are using. Without these >nobody can help you. > >--Guido van Rossum (home page: http://www.python.org/~guido/) > >_______________________________________________ >DB-SIG maillist - DB-SIG@python.org >http://mail.python.org/mailman/listinfo/db-sig From misa at redhat.com Mon May 24 11:57:14 2004 From: misa at redhat.com (Mihai Ibanescu) Date: Tue May 25 14:11:51 2004 Subject: [DB-SIG] perl-DBI like module for Python? Message-ID: <20040524155714.GH29428@umberto.devel.redhat.com> Hello, I am not sure if it was mentioned before on this list. Is there a module that does what the perl DBI module does? What I mean by that is: a top-level module that exposes the API defined in the DB API document, but with the ability to change backend drivers on the fly. Example: I have my application running against Postgres. I have to be able to port it to Oracle too. Unfortunately, code that tries to catch DatabaseException will have to look for the cx_Oracle DatabaseException, not for the postgres one. This would be easily solved if a DBI module would provide the base classes (for things like Database, Cursor, DatabaseException etc.) that the code could use, and a connect function that could specify the database driver to use (postgres, cx_Oracle etc). Drivers would inherit their classes from this top-level module. jdbc/odbc do the same thing. Is there such a thing out there? Thanks, Misa (re-inventing the wheel) From mal at egenix.com Tue May 25 17:05:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue May 25 17:05:46 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <20040524155714.GH29428@umberto.devel.redhat.com> References: <20040524155714.GH29428@umberto.devel.redhat.com> Message-ID: <40B3B51E.8050308@egenix.com> Mihai Ibanescu wrote: > Hello, > > I am not sure if it was mentioned before on this list. > Is there a module that does what the perl DBI module does? > What I mean by that is: a top-level module that exposes the API defined in the > DB API document, but with the ability to change backend drivers on the fly. > > Example: I have my application running against Postgres. I have to be able to > port it to Oracle too. Unfortunately, code that tries to catch > DatabaseException will have to look for the cx_Oracle DatabaseException, not > for the postgres one. > > This would be easily solved if a DBI module would provide the base classes > (for things like Database, Cursor, DatabaseException etc.) that the code could > use, and a connect function that could specify the database driver to use > (postgres, cx_Oracle etc). Drivers would inherit their classes from this > top-level module. > > jdbc/odbc do the same thing. > > Is there such a thing out there? If you're looking for a true DBI kind of approach: mxODBC... * works with Oracle, MS SQL Server, SAP DB, PostgreSQL, etc. etc. * same API for all of these * same API on Windows, Unix, *BSD, AIX, etc. etc. * supported * under active development OTOH, the Python DB API provides a specification of how database modules should interface to the Python program. Since Python binds based on name, that comes very close to the DBI kind of approach as well. In any case, most work usually goes into porting the SQL layer of the application, not the interface layer beneath it. Porting from Postgres to Oracle is not as hard at the interface level, but you'll find that porting the SQL concepts can be very time consuming. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 25 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2004, G?teborg, Sweden 12 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From stuart.b at commonground.com.au Wed May 26 08:02:45 2004 From: stuart.b at commonground.com.au (Stuart Bishop) Date: Wed May 26 08:03:06 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <20040524155714.GH29428@umberto.devel.redhat.com> References: <20040524155714.GH29428@umberto.devel.redhat.com> Message-ID: <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 24/05/2004, at 4:57 PM, Mihai Ibanescu wrote: > Hello, > > I am not sure if it was mentioned before on this list. > Is there a module that does what the perl DBI module does? > What I mean by that is: a top-level module that exposes the API > defined in the > DB API document, but with the ability to change backend drivers on the > fly. No. The drivers have enough functionality that this extra layer is generally not needed. The major desire for such a library would be to standardize the parameter style used. > Example: I have my application running against Postgres. I have to be > able to > port it to Oracle too. Unfortunately, code that tries to catch > DatabaseException will have to look for the cx_Oracle > DatabaseException, not > for the postgres one. The exceptions are most likely exposed through your connection object (I think most the major drivers support this option now?). try: cur = con.cursor() cur.excecute('select foo from bar') except con.DatabaseException: print 'Oops!' - -- Stuart Bishop http://www.stuartbishop.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFAtIdrAfqZj7rGN0oRAupyAJ928Z2ZMeU/ukTYQYq07xOUna8CSgCdHYo0 6H4MLrRUZjhrTP0k50Y5E4A= =KKkP -----END PGP SIGNATURE----- From jacobs at theopalgroup.com Wed May 26 08:32:00 2004 From: jacobs at theopalgroup.com (Kevin Jacobs) Date: Wed May 26 08:32:04 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> References: <20040524155714.GH29428@umberto.devel.redhat.com> <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> Message-ID: <40B48E40.7030701@theopalgroup.com> Stuart Bishop wrote: > On 24/05/2004, at 4:57 PM, Mihai Ibanescu wrote: > >> Example: I have my application running against Postgres. I have to be >> able to >> port it to Oracle too. Unfortunately, code that tries to catch >> DatabaseException will have to look for the cx_Oracle >> DatabaseException, not >> for the postgres one. > > > The exceptions are most likely exposed through your connection object > (I think most the major drivers support this option now?). > > try: > cur = con.cursor() > cur.excecute('select foo from bar') > except con.DatabaseException: > print 'Oops!' > A more portable way is to use my exception virtualization technique that allows the use of a standard set of exceptions to catch exceptions generated from registered db-api modules: dbapi_exceptions = [ 'Warning', 'Error', 'InterfaceError', 'DatabaseError', 'DataError', 'OperationalError', 'IntegrityError', 'InternalError', 'ProgrammingError', 'NotSupportedError' ] class Warning (StandardError) : pass class Error (StandardError) : pass class InterfaceError (Error) : pass class DatabaseError (Error) : pass class DataError (DatabaseError) : pass class OperationalError (DatabaseError) : pass class IntegrityError (DatabaseError) : pass class InternalError (DatabaseError) : pass class ProgrammingError (DatabaseError) : pass class NotSupportedError (DatabaseError) : pass def __import_exceptions(module): for e in dbapi_exceptions: sub_exception = getattr(module, e) global_exception = globals()[e] if global_exception not in sub_exception.__bases__: sub_exception.__bases__ += (global_exception,) One can then "register" a db-api module to allow exceptions to be caught from the above virtual exceptions: import psycopg import popy import mysqldb __import_exceptions(psycopg) __import_exceptions(popy) __import_exceptions(mysqldb) -Kevin From misa at redhat.com Wed May 26 09:49:38 2004 From: misa at redhat.com (Mihai Ibanescu) Date: Wed May 26 09:50:04 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> References: <20040524155714.GH29428@umberto.devel.redhat.com> <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> Message-ID: <20040526134938.GM29428@umberto.devel.redhat.com> On Wed, May 26, 2004 at 01:02:45PM +0100, Stuart Bishop wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > On 24/05/2004, at 4:57 PM, Mihai Ibanescu wrote: > > >Hello, > > > >I am not sure if it was mentioned before on this list. > >Is there a module that does what the perl DBI module does? > >What I mean by that is: a top-level module that exposes the API > >defined in the > >DB API document, but with the ability to change backend drivers on the > >fly. > > No. > > The drivers have enough functionality that this extra layer is > generally not needed. The major desire for such a library > would be to standardize the parameter style used. I tend to disagree. If I want to write an application that populates a Microsoft SQL database with data from an Oracle server (i.e. maintaining connections to different kinds of databases at the same time), then I would like to be able to catch exceptions in a sane way, without jumping through hoops of 'this is a Microsoft DatabaseError while this is an Oracle DatabaseError'). One could always use an intermediate step (dump the data in a shelve or something like that), but I hope you see my point. > >Example: I have my application running against Postgres. I have to be > >able to > >port it to Oracle too. Unfortunately, code that tries to catch > >DatabaseException will have to look for the cx_Oracle > >DatabaseException, not > >for the postgres one. > > The exceptions are most likely exposed through your connection object > (I think most the major drivers support this option now?). > > try: > cur = con.cursor() > cur.excecute('select foo from bar') > except con.DatabaseException: > print 'Oops!' That is not the case in cx_Oracle or DCOracle2. It should be part of the DB API if you want to rely on this. Misa From anthony at computronix.com Wed May 26 09:51:13 2004 From: anthony at computronix.com (Anthony Tuininga) Date: Wed May 26 09:51:20 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> References: <20040524155714.GH29428@umberto.devel.redhat.com> <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> Message-ID: <40B4A0D1.7010200@computronix.com> Stuart Bishop wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > On 24/05/2004, at 4:57 PM, Mihai Ibanescu wrote: > >> Example: I have my application running against Postgres. I have to be >> able to >> port it to Oracle too. Unfortunately, code that tries to catch >> DatabaseException will have to look for the cx_Oracle >> DatabaseException, not >> for the postgres one. > > > The exceptions are most likely exposed through your connection object > (I think most the major drivers support this option now?). > > try: > cur = con.cursor() > cur.excecute('select foo from bar') > except con.DatabaseException: > print 'Oops!' Huh? My reading of the DB API says that the exceptions are defined at the __MODULE__ level, not the __CONNECTION__ level. Or am I missing something??? Please inform me! > - -- Stuart Bishop > http://www.stuartbishop.net/ > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.3 (Darwin) > > iD8DBQFAtIdrAfqZj7rGN0oRAupyAJ928Z2ZMeU/ukTYQYq07xOUna8CSgCdHYo0 > 6H4MLrRUZjhrTP0k50Y5E4A= > =KKkP > -----END PGP SIGNATURE----- > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From misa at redhat.com Wed May 26 09:57:38 2004 From: misa at redhat.com (Mihai Ibanescu) Date: Wed May 26 09:57:59 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <40B3B51E.8050308@egenix.com> References: <20040524155714.GH29428@umberto.devel.redhat.com> <40B3B51E.8050308@egenix.com> Message-ID: <20040526135738.GN29428@umberto.devel.redhat.com> On Tue, May 25, 2004 at 11:05:34PM +0200, M.-A. Lemburg wrote: > Mihai Ibanescu wrote: > >Hello, > > > >I am not sure if it was mentioned before on this list. > >Is there a module that does what the perl DBI module does? > >What I mean by that is: a top-level module that exposes the API defined in > >the > >DB API document, but with the ability to change backend drivers on the fly. > > > >Example: I have my application running against Postgres. I have to be able > >to > >port it to Oracle too. Unfortunately, code that tries to catch > >DatabaseException will have to look for the cx_Oracle DatabaseException, > >not > >for the postgres one. > > > >This would be easily solved if a DBI module would provide the base classes > >(for things like Database, Cursor, DatabaseException etc.) that the code > >could > >use, and a connect function that could specify the database driver to use > >(postgres, cx_Oracle etc). Drivers would inherit their classes from this > >top-level module. > > > >jdbc/odbc do the same thing. > > > >Is there such a thing out there? > > If you're looking for a true DBI kind of approach: > > mxODBC... > * works with Oracle, MS SQL Server, SAP DB, PostgreSQL, etc. etc. > * same API for all of these > * same API on Windows, Unix, *BSD, AIX, etc. etc. > * supported > * under active development Thanks for the pointer, will look into it. > OTOH, the Python DB API provides a specification of how database > modules should interface to the Python program. Since Python binds > based on name, that comes very close to the DBI kind of approach > as well. > > In any case, most work usually goes into porting the SQL > layer of the application, not the interface layer beneath > it. Porting from Postgres to Oracle is not as hard at > the interface level, but you'll find that porting the > SQL concepts can be very time consuming. I know :-) I chose postgres and Oracle as an example. In my case I have to use two different database modules for Oracle - cx_Oracle and DCOracle. So the SQL is mostly the same (except that DCOracle implements the DB API v1.0 so there are some intricacies there). Thanks for your suggestion. Misa From stuart.b at commonground.com.au Wed May 26 10:03:31 2004 From: stuart.b at commonground.com.au (Stuart Bishop) Date: Wed May 26 10:03:47 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <40B4A0D1.7010200@computronix.com> References: <20040524155714.GH29428@umberto.devel.redhat.com> <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> <40B4A0D1.7010200@computronix.com> Message-ID: <7885A2DC-AF1D-11D8-9F3B-000A95A06FC6@commonground.com.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 26/05/2004, at 2:51 PM, Anthony Tuininga wrote: > Stuart Bishop wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> On 24/05/2004, at 4:57 PM, Mihai Ibanescu wrote: >>> Example: I have my application running against Postgres. I have to >>> be able to >>> port it to Oracle too. Unfortunately, code that tries to catch >>> DatabaseException will have to look for the cx_Oracle >>> DatabaseException, not >>> for the postgres one. >> The exceptions are most likely exposed through your connection object >> (I think most the major drivers support this option now?). >> try: >> cur = con.cursor() >> cur.excecute('select foo from bar') >> except con.DatabaseException: >> print 'Oops!' > > Huh? My reading of the DB API says that the exceptions are defined at > the __MODULE__ level, not the __CONNECTION__ level. Or am I missing > something??? Please inform me! Its one of the optional extensions. Search for 'Connection Attributes .Error' in http://www.python.org/peps/pep-0249.html I think it is high time to release DB-API 2.1 with most of the optional extensions moved to core. - -- Stuart Bishop http://www.stuartbishop.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFAtKO0AfqZj7rGN0oRAg+HAJ9SFcLm5DHuJx85Il+p+jVrFv6kKACeIr/b NexERzNYrT5Rpl8xndIp6f8= =EMX6 -----END PGP SIGNATURE----- From mal at egenix.com Wed May 26 10:43:48 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed May 26 10:48:58 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <40B4A0D1.7010200@computronix.com> References: <20040524155714.GH29428@umberto.devel.redhat.com> <99578656-AF0C-11D8-9F3B-000A95A06FC6@commonground.com.au> <40B4A0D1.7010200@computronix.com> Message-ID: <40B4AD24.8090409@egenix.com> Anthony Tuininga wrote: > Stuart Bishop wrote: > > > On 24/05/2004, at 4:57 PM, Mihai Ibanescu wrote: > >>>> Example: I have my application running against Postgres. I have to be >>>> able to >>>> port it to Oracle too. Unfortunately, code that tries to catch >>>> DatabaseException will have to look for the cx_Oracle >>>> DatabaseException, not >>>> for the postgres one. > > > > The exceptions are most likely exposed through your connection object > (I think most the major drivers support this option now?). > > try: > cur = con.cursor() > cur.excecute('select foo from bar') > except con.DatabaseException: > print 'Oops!' > > >> Huh? My reading of the DB API says that the exceptions are defined at >> the __MODULE__ level, not the __CONNECTION__ level. Or am I missing >> something??? Please inform me! This is one of the optional DB API extensions: Connection Attributes .Error, .ProgrammingError, etc. All exception classes defined by the DB API standard should be exposed on the Connection objects are attributes (in addition to being available at module scope). These attributes simplify error handling in multi-connection environments. Warning Message: "DB-API extension connection. used" See the Optional DB API Extensions section. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2004, G?teborg, Sweden 11 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From ods at strana.ru Wed May 26 11:26:19 2004 From: ods at strana.ru (Denis S. Otkidach) Date: Wed May 26 11:28:08 2004 Subject: [DB-SIG] perl-DBI like module for Python? In-Reply-To: <40B4A0D1.7010200@computronix.com> Message-ID: On Wed, 26 May 2004, Anthony Tuininga wrote: AT> > try: AT> > cur = con.cursor() AT> > cur.excecute('select foo from bar') AT> > except con.DatabaseException: AT> > print 'Oops!' AT> AT> Huh? My reading of the DB API says that the exceptions are AT> defined at AT> the __MODULE__ level, not the __CONNECTION__ level. Or am I AT> missing AT> something??? Please inform me! I see no problem here. con = db_module.connect(...) cur = con.cursor() ... try: cur.excecute('select foo from bar') except db_module.DatabaseException: print 'Oops!' But exposing exceptions as connection attributes would be more convinient. -- Denis S. Otkidach http://www.python.ru/ [ru] From LyndonKipps8519 at legislator.com Thu May 27 18:22:25 2004 From: LyndonKipps8519 at legislator.com (Carldrick Gadson) Date: Thu May 27 17:23:37 2004 Subject: [DB-SIG] Fwd: check this out Message-ID: <200405272123.i4RLNV3T013360@mxzilla2.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040527/777d1c69/attachment.html From waechter at cenix-bioscience.com Fri May 28 10:23:24 2004 From: waechter at cenix-bioscience.com (Thomas Waechter) Date: Fri May 28 10:23:29 2004 Subject: [DB-SIG] mxODBC: Function sequence error In-Reply-To: <40B20B83.4070705@egenix.com> References: <40B1F4AF.2030106@cenix-bioscience.com> <40B20B83.4070705@egenix.com> Message-ID: <40B74B5C.8090101@cenix-bioscience.com> > Try to compile a version of mxODBC with debugging enabled > > python setup.py mx_autoconf --enable-debug install I tried to compile mxODBC, but it didn't compile through. It worked for mx-base, but mx-commercial stopped with the following error: C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -IC:\allusers\tw856136\python\incl ude -IC:\allusers\tw856136\python\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : Unbekannte Groesse failure. removing: _configtest.c _configtest.obj running install running build running build_ext building 'mx.ODBC.Windows.mxODBC' extension C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -DMS_ODBC_MANAGER -DBAD_STATIC_FORWARD=1 -DMAL_DEB UG -UHAVE_STRPTIME -UHAVE_TIMEGM -Imx/ODBC/Windows -IC:\allusers\tw856136\python \include -IC:\allusers\tw856136\python\PC /Tpmx/ODBC/Windows/mxODBC.cpp /Fobuild \temp.win32-2.3\Release\mx\ODBC\Windows\mxODBC\mx/ODBC/Windows/mxODBC.obj mxODBC.cpp mx/ODBC/Windows/mxODBC.cpp(593) : error C2133: 'mxODBCursor_Methods' : Unbekannte Groesse mx/ODBC/Windows/mxODBC.cpp(5799) : error C2086: 'mxODBCursor_Methods' : Neudefinition mx/ODBC/Windows/mxODBC.cpp(5870) : error C2133: 'mxODBC_Methods' : Unbekannte Groesse mx/ODBC/Windows/mxODBC.cpp(6528) : error C2086: 'mxODBC_Methods' : Neudefinition error: command '"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe"' failed with exit status 2 Is there anything special? Unfortunately I couldn't have a look for help at the website, because egenix.com it is down at the moment. Cheers Thomas Waechter -- Thomas Waechter Software Developer Cenix BioScience BioInnovations Zentrum Tatzberg 46 D-01307 Dresden Germany Tel : +49 (0)351 4173 0155 e-mail : waechter@cenix-bioscience.com Cenix Website : http://www.cenix-bioscience.com From mal at egenix.com Fri May 28 10:47:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri May 28 10:47:23 2004 Subject: [DB-SIG] mxODBC: Function sequence error In-Reply-To: <40B74B5C.8090101@cenix-bioscience.com> References: <40B1F4AF.2030106@cenix-bioscience.com> <40B20B83.4070705@egenix.com> <40B74B5C.8090101@cenix-bioscience.com> Message-ID: <40B750F6.50905@egenix.com> Thomas Waechter wrote: >> Try to compile a version of mxODBC with debugging enabled >> >> python setup.py mx_autoconf --enable-debug install > > I tried to compile mxODBC, but it didn't compile through. It worked for > mx-base, but mx-commercial stopped with the following error: This due to some code having been removed from the Python 2.3 header files. We'll upload a debug to our web-server later today. > C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD > /W3 /GX > /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 > -IC:\allusers\tw856136\python\incl > ude -IC:\allusers\tw856136\python\include /Tc_configtest.c > /Fo_configtest.obj > _configtest.c > _configtest.c(5) : error C2133: 'mxarray' : Unbekannte Groesse > failure. > removing: _configtest.c _configtest.obj > running install > running build > running build_ext > building 'mx.ODBC.Windows.mxODBC' extension > C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD > /W3 /GX > /DNDEBUG /O2 /Gf /GB /GD /Ob2 -DMS_ODBC_MANAGER -DBAD_STATIC_FORWARD=1 > -DMAL_DEB > UG -UHAVE_STRPTIME -UHAVE_TIMEGM -Imx/ODBC/Windows > -IC:\allusers\tw856136\python > \include -IC:\allusers\tw856136\python\PC /Tpmx/ODBC/Windows/mxODBC.cpp > /Fobuild > \temp.win32-2.3\Release\mx\ODBC\Windows\mxODBC\mx/ODBC/Windows/mxODBC.obj > mxODBC.cpp > mx/ODBC/Windows/mxODBC.cpp(593) : error C2133: 'mxODBCursor_Methods' : > Unbekannte Groesse > mx/ODBC/Windows/mxODBC.cpp(5799) : error C2086: 'mxODBCursor_Methods' : > Neudefinition > mx/ODBC/Windows/mxODBC.cpp(5870) : error C2133: 'mxODBC_Methods' : > Unbekannte Groesse > mx/ODBC/Windows/mxODBC.cpp(6528) : error C2086: 'mxODBC_Methods' : > Neudefinition > error: command '"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe"' > failed with exit status 2 > > Is there anything special? Unfortunately I couldn't have a look for help > at the website, because egenix.com it is down at the moment. Thanks for the note; we had some network problems. Should be fixed again now. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2004, G?teborg, Sweden 9 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From BDULON at sqli.com Fri May 28 12:04:39 2004 From: BDULON at sqli.com (Benjamin DULON) Date: Fri May 28 12:17:01 2004 Subject: [DB-SIG]DCOracle2 rounded floats Message-ID: <192353F2A074154C82068805541676F255796F@mailhost.sqli.com> Thanks, I effectively tried with cx_Oracle, and everything goes right now ! Very curious ... Benjamin DULON. Why don't you try cx_Oracle instead? At least if you run into problems with it I can help you. :-) You can acquire a copy from http://starship.python.net/crew/atuining Anthony Benjamin DULON wrote: > Hi, > > > > I haven't got any response, nobody has encountered this problem ? I > think I need to recompile DCO2, but I can't get any information about > configurations' options. > > It seems that it returns float type as default. > > > > DCO2 is installed under RedHat 9. > > > > Any help will be appreciated. > > > > Thanks, > > > > Benjamin DULON. > > > > > > Hello, > > > > I'm newbie in DCO2 and python, and I encounter an issue. > > In Oracle8i, I try to get Number data type. From SQLPlus, no problem, > but using dco2, floats are rounded. > > Instead of having 0.975 I get 1.0 > > My code : > > > > Conn = DCOracle2.connect(connect_string) > > C = conn.cursor() > > c.execute('select * from t_sqli where id=4') > > r = c.fetchall() > > print entry > > > > It returns : [4.0,'QUATRE','d',3.0] > > > > It should be : [4,'QUATRE','d',3.1414155225] > > > > Trying directly in using sqlplus : no problem. > > The environnement is Python2.2, DCO2, RedHat9, Oracle8.1.7 > > > > Thanks a lot. > > > > Benjamin DULON. > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig From ronfrank at xintangren.com Sat May 29 10:12:57 2004 From: ronfrank at xintangren.com (ronfrank@xintangren.com) Date: Sat May 29 10:11:03 2004 Subject: [DB-SIG] U.S. Troops, Sadr Militia Clash After Iraq Truce Message-ID: <200405291410.i4TEArEY096484@mxzilla7.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040529/4cb36f42/attachment.html From teddy at dde.dk Sat May 29 16:21:26 2004 From: teddy at dde.dk (teddy@dde.dk) Date: Sat May 29 23:22:24 2004 Subject: [DB-SIG] Db-sig, bright teen girls In-Reply-To: <4J8A57A06DKC8FAF@python.org> References: <4J8A57A06DKC8FAF@python.org> Message-ID: <3F287D967I617609@dde.dk> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20040529/cffd16a9/attachment.html From rrk at prairie.lakes.com Sun May 30 19:34:53 2004 From: rrk at prairie.lakes.com (rrk) Date: Sun May 30 19:34:07 2004 Subject: [DB-SIG] using stored functions in postgres with pgdb module how? Message-ID: <40BA6F9D.4060704@prairie.lakes.com> does any one know the syntax for calling a stored function in postgres thru pgdb python package i have run out of guess's. i have a stored function to the check a phone number against an employee table when i rvc a caller . it seems think it is a executemany no mater what i do and that includes using a %s pram thanks rrk From fog at initd.org Mon May 31 08:13:19 2004 From: fog at initd.org (Federico Di Gregorio) Date: Mon May 31 08:13:48 2004 Subject: [DB-SIG] using stored functions in postgres with pgdb module how? In-Reply-To: <40BA6F9D.4060704@prairie.lakes.com> References: <40BA6F9D.4060704@prairie.lakes.com> Message-ID: <1086005599.3424.17.camel@localhost> L? domenica, 2004/05/30 alle 18:34, -0500, rrk ha scritto: > does any one know the syntax for calling a stored function in postgres > thru pgdb python package if it has execute (and must have) you just do: curs.execute("SELECT stored_procedure(%s, %s, ...)", (param1, param2)) or the right param style for your database driver. federico -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata Url : http://mail.python.org/pipermail/db-sig/attachments/20040531/bb3f98ae/attachment.bin