From fgeter@itc.nrcs.usda.gov Tue Apr 1 21:23:29 2003 From: fgeter@itc.nrcs.usda.gov (Geter, Frank) Date: Tue, 1 Apr 2003 14:23:29 -0700 Subject: [DB-SIG] Simple query failure to MS SQL Server Database using mx.ODBC.Wind ows Message-ID: <768D32B675BED311968F009027DE9E3001D00E40@rocky.itc.nrcs.usda.gov> I am trying to use mx.ODBC.Windows connect to a remote MSSQL database through my local ODBC data object called OipNcapsData. I am running Windows 2000 and I downloaded and installed the mxODBC files yesterday. I can connect to the database using the same object and successfully run queries against it using other tools. I have checked with the database people and I have permission on the view and tables behind it that I am trying to access. The following is the python code that shows the error. After that code is more code showing another python odbc connection using the same ODBC object that works. Code that does no work ---------------------- Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.Windows >>> db=mx.ODBC.Windows.DriverConnect('DSN=OipNcapsData') >>> c=db.cursor() >>> c.execute('select * from site') Traceback (most recent call last): File "", line 1, in ? mxODBC.Warning: ('01000', 7312, '[Microsoft][ODBC SQL Server Driver][SQL Server][OLE/DB provider returned message: New transaction cannot enlist in the specifie d transaction coordinator. ]', 4606) Code that works --------------- >>> import odbc, dbi >>> db=odbc.odbc('OipNcapsData//') >>> c=db.cursor() >>> c.execute('select site_id from site where site_id < 25') 0 >>> c.fetchall() [(1,), (2,), (3,), (4,), (5,), (6,), (7,), (9,), (10,), (11,), (12,), (13,), (14,), (15,), (16,), (17,), (18,), (19,), (20,), (21,), (22,), (23,)] >>> Frank Geter 2150 Centre Avenue, Bldg. A Fort Collins, CO 80526-1891 Ph# (970) 295-5536 Fax# (970) 295-5414 From jh@web.de Tue Apr 1 22:19:35 2003 From: jh@web.de (Juergen Hermann) Date: Wed, 02 Apr 2003 00:19:35 +0200 Subject: [DB-SIG] Unit tests for DBAPI 2.0 Message-ID: Hi! Are=20there=20any=20generic=20unit=20tests=20for=20DBAPI=202.0?=20Or=20tes= ts=20in=20an=20existing=20 db=20api=20implementation=20that=20could=20be=20used=20as=20a=20basis? Ciao,=20J=FCrgen From daniel.dittmar@sap.com Wed Apr 2 19:04:09 2003 From: daniel.dittmar@sap.com (Daniel Dittmar) Date: Wed, 02 Apr 2003 21:04:09 +0200 Subject: [DB-SIG] Re: Unit tests for DBAPI 2.0 In-Reply-To: References: Message-ID: Juergen Hermann wrote: > Are there any generic unit tests for DBAPI 2.0? Or tests in an existing > db api implementation that could be used as a basis? http://stuartbishop.net/Software/DBAPI20TestSuite/ see the thread 'DB API 2.0 Anal Compliance Unit Test for review' of this list starting 13-Feb-03 01:25 for any additional details. Daniel Dittmar -- Daniel Dittmar SAP DB, SAP Labs Berlin daniel.dittmar@sap.com http://www.sapdb.org From zen@shangri-la.dropbear.id.au Thu Apr 3 09:47:14 2003 From: zen@shangri-la.dropbear.id.au (Stuart Bishop) Date: Thu, 3 Apr 2003 19:47:14 +1000 Subject: [DB-SIG] Unit tests for DBAPI 2.0 In-Reply-To: Message-ID: <3F935FF1-65B9-11D7-9F31-000393B63DDC@shangri-la.dropbear.id.au> On Wednesday, April 2, 2003, at 08:19 AM, Juergen Hermann wrote: > Hi! > > Are there any generic unit tests for DBAPI 2.0? Or tests in an existing > db api implementation that could be used as a basis? http://stuartbishop.net/Software/DBAPI20TestSuite/ -- Stuart Bishop http://shangri-la.dropbear.id.au/ From mal@lemburg.com Fri Apr 4 16:09:51 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Fri, 04 Apr 2003 18:09:51 +0200 Subject: [DB-SIG] Simple query failure to MS SQL Server Database using mx.ODBC.Wind ows In-Reply-To: <768D32B675BED311968F009027DE9E3001D00E40@rocky.itc.nrcs.usda.gov> References: <768D32B675BED311968F009027DE9E3001D00E40@rocky.itc.nrcs.usda.gov> Message-ID: <3E8DAE4F.8070604@lemburg.com> Geter, Frank wrote: > I am trying to use mx.ODBC.Windows connect to a remote MSSQL database > through my local ODBC data object called OipNcapsData. I am running Windows > 2000 and I downloaded and installed the mxODBC files yesterday. I can > connect to the database using the same object and successfully run queries > against it using other tools. I have checked with the database people and I > have permission on the view and tables behind it that I am trying to access. > The following is the python code that shows the error. After that code is > more code showing another python odbc connection using the same ODBC object > that works. > > Code that does no work > ---------------------- > Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.Windows >>>>db=mx.ODBC.Windows.DriverConnect('DSN=OipNcapsData') >>>>c=db.cursor() >>>>c.execute('select * from site') > > Traceback (most recent call last): > File "", line 1, in ? > mxODBC.Warning: ('01000', 7312, '[Microsoft][ODBC SQL Server Driver][SQL > Server][OLE/DB provider returned message: New transaction cannot enlist in > the specifie > d transaction coordinator. ]', 4606) Please note that unlike the simple win32 odbc module, mxODBC defaults to transactional mode after a connect. The odbc module goes into auto-commit mode after a connect. The error you are seeing seems to be related to some transaction manager the database is using for managing transactions. Since the odbc module does use transactions per default, you don't get the error messages. The work-around is easy: use the Fortunately, mxODBC offers to a way to connect in auto-commit mode as well: DriverConnect(DSN_string[, clear_auto_commit=1]) ... If you get an exception during connect telling you that the driver is not capable or does not support transactions, e.g. mxODBC.NotSupportedError: ('S1C00', 84, '[Microsoft][ODBC Excel Driver]Driver not capable ', 4226), please try to connect with clear_auto_commit set to 0. db = mx.ODBC.DriverConnect('DSN=OipNcapsData', 0) should give you the same results as with the odbc module. However, what you really want is to use transcations (since they prevent data corruption), so you should ask your DBAs about the cause of the problem. > Code that works > --------------- > >>>>import odbc, dbi >>>>db=odbc.odbc('OipNcapsData//') >>>>c=db.cursor() >>>>c.execute('select site_id from site where site_id < 25') > > 0 > >>>>c.fetchall() > > [(1,), (2,), (3,), (4,), (5,), (6,), (7,), (9,), (10,), (11,), (12,), (13,), > (14,), (15,), (16,), (17,), (18,), (19,), (20,), (21,), (22,), (23,)] > > > > Frank Geter > 2150 Centre Avenue, Bldg. A > Fort Collins, CO 80526-1891 > Ph# (970) 295-5536 > Fax# (970) 295-5414 > > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 04 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 81 days left From ianb@colorstudy.com Tue Apr 8 05:32:26 2003 From: ianb@colorstudy.com (Ian Bicking) Date: 07 Apr 2003 23:32:26 -0500 Subject: [DB-SIG] ANN: SQLObject 0.3 Message-ID: <1049776345.764.94.camel@lothlorien> SQLObject 0.3 has been release: http://sqlobject.org Changes ------- * Automatic table creation based off class. * Create classes from database. * Dynamically add and remove columns to live classes and databases. * anydbm-based backend (queryable database without SQL). * Better caching. * Some bugs fixed. What is it? ----------- SQLObject is an object-relational mapper. It allows you to translate RDBMS table rows into Python objects, and manipulate those objects to transparently manipulate the database. SQLObject emphasizes convenience. It's easy to learn and easy to use, and doesn't require too much typing or use of any tools outside of your editor and your Python source. -- Ian Bicking ianb@colorstudy.com http://colorstudy.com 4869 N. Talman Ave., Chicago, IL 60625 / 773-275-7241 "There is no flag large enough to cover the shame of killing innocent people" -- Howard Zinn From zen@shangri-la.dropbear.id.au Thu Apr 10 01:34:50 2003 From: zen@shangri-la.dropbear.id.au (Stuart Bishop) Date: Thu, 10 Apr 2003 10:34:50 +1000 Subject: [DB-SIG] DB API 2.0 Anal Compliance Unit Test for review In-Reply-To: <37A3E022-4549-11D7-9AB7-000393B63DDC@shangri-la.dropbear.id.au> Message-ID: <3D32D42D-6AEC-11D7-9FD0-000393B63DDC@shangri-la.dropbear.id.au> On Friday, February 21, 2003, at 02:04 PM, Stuart Bishop wrote: > I've added this test to the CVS copy, to be uploaded to > stuartbishop.net > after I've dealt with the other outstanding issues. Release 1.8 is now available at: http://stuartbishop.net/Software/DBAPI20TestSuite/ As far as I am aware, all outstanding suggestions and requests are now in there and this may very well be the final release. -- Stuart Bishop http://shangri-la.dropbear.id.au/ From rmangaliag at slu.edu.ph Fri Apr 11 10:09:58 2003 From: rmangaliag at slu.edu.ph (ali) Date: Thu Apr 10 20:58:34 2003 Subject: [DB-SIG] Re: DB-SIG digest, Vol 1 #815 - 1 msg Message-ID: <200304110118.h3B1Ir78009730@mbox.slu.edu.ph> hi... i just would like to ask if you have tried using sap db with python??? and if yes, what can you say? (in relation to other open/free databases) thanks.. ali ======= At 2003-04-10, 12:00:00 you wrote: ======= >Send DB-SIG mailing list submissions to > db-sig@python.org > >To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/db-sig >or, via email, send a message with subject or body 'help' to > db-sig-request@python.org > >You can reach the person managing the list at > db-sig-admin@python.org > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of DB-SIG digest..." > > >Today's Topics: > > 1. Re: DB API 2.0 Anal Compliance Unit Test for review (Stuart Bishop) > >--__--__-- > >Message: 1 >Date: Thu, 10 Apr 2003 10:34:50 +1000 >Subject: Re: [DB-SIG] DB API 2.0 Anal Compliance Unit Test for review >From: Stuart Bishop >To: db-sig@python.org > > >On Friday, February 21, 2003, at 02:04 PM, Stuart Bishop wrote: > >> I've added this test to the CVS copy, to be uploaded to >> stuartbishop.net >> after I've dealt with the other outstanding issues. > >Release 1.8 is now available at: > http://stuartbishop.net/Software/DBAPI20TestSuite/ > >As far as I am aware, all outstanding suggestions and requests >are now in there and this may very well be the final release. > >-- >Stuart Bishop >http://shangri-la.dropbear.id.au/ > > > > > >End of DB-SIG Digest = = = = = = = = = = = = = = = = = = = = Best regards. ali rmangaliag@mbox.slu.edu.ph 2003-04-11 From mal at lemburg.com Fri Apr 11 12:10:27 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Apr 11 05:11:06 2003 Subject: [DB-SIG] SAP DB In-Reply-To: <200304110118.h3B1Ir78009730@mbox.slu.edu.ph> References: <200304110118.h3B1Ir78009730@mbox.slu.edu.ph> Message-ID: <3E968683.2030605@lemburg.com> ali wrote: > hi... > > i just would like to ask if you have tried using sap db with python??? and if yes, what can you say? (in relation to other open/free databases) Works like a charm... we've been using it on our production systems for more than two years now. The only gripe I have is that power failure sometimes crashes the database indexes (because SAP DB tries to store these in memory). Fortunately, rebuilding them takes just one admin command and SAP DB then rebuilds them itself. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 11 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 74 days left From rmangaliag at slu.edu.ph Fri Apr 11 18:27:05 2003 From: rmangaliag at slu.edu.ph (ali) Date: Fri Apr 11 05:15:34 2003 Subject: [DB-SIG] a question on bbs Message-ID: <200304110936.h3B9a478014727@mbox.slu.edu.ph> hi... i am thinking of creating a bbs project to show my students... i'm thinking of using spyce and firebird (kinterbasdb) to do the trick... my question is: can you give sample database metadata/database structure of existing bbs's?? or atleast a location of where i can get one?? thanks... Best regards. ali rmangaliag@mbox.slu.edu.ph 2003-04-11 From rmangaliag at slu.edu.ph Fri Apr 11 18:31:41 2003 From: rmangaliag at slu.edu.ph (ali) Date: Fri Apr 11 05:20:06 2003 Subject: [DB-SIG] SAP DB Message-ID: <200304110940.h3B9ef78015110@mbox.slu.edu.ph> thanks for the reply... would you recommend it over postgresql??? a lot of my friends are saying that among all free databases, postgresql can go head to head against other commercial rdbms (like oracle and mssql)... of course, i'm referring to enterprise level databasing... is this true??? again, thanks... ali ======= At 2003-04-11, 11:10:00 you wrote: ======= >ali wrote: >> hi... >> >> i just would like to ask if you have tried using sap db with python??? and if yes, what can you say? (in relation to other open/free databases) > >Works like a charm... we've been using it on our production systems >for more than two years now. > >The only gripe I have is that power failure sometimes crashes the >database indexes (because SAP DB tries to store these in memory). >Fortunately, rebuilding them takes just one admin command and >SAP DB then rebuilds them itself. > >-- >Marc-Andre Lemburg >eGenix.com > >Professional Python Software directly from the Source (#1, Apr 11 2003) > >>> Python/Zope Products & Consulting ... http://www.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >________________________________________________________________________ >EuroPython 2003, Charleroi, Belgium: 74 days left = = = = = = = = = = = = = = = = = = = = Best regards. ali rmangaliag@mbox.slu.edu.ph 2003-04-11 From mal at lemburg.com Fri Apr 11 12:31:20 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Apr 11 05:32:00 2003 Subject: [DB-SIG] SAP DB In-Reply-To: <200304110940.h3B9ef78015110@mbox.slu.edu.ph> References: <200304110940.h3B9ef78015110@mbox.slu.edu.ph> Message-ID: <3E968B68.9040302@lemburg.com> ali wrote: > thanks for the reply... > > would you recommend it over postgresql??? > > a lot of my friends are saying that among all free databases, postgresql can go head to head against other commercial rdbms (like oracle and mssql)... of course, i'm referring to enterprise level databasing... > > is this true??? Can't really say, postgresql is a fast moving target these days :-) SAP DB OTOH is a commercial database that happens to be available as Open Source software. And SAP is putting quite a bit of effort into supporting it. That sure makes selling it to customers a lot easier :-) -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 11 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 74 days left From spage at rightnow.com Fri Apr 11 11:32:11 2003 From: spage at rightnow.com (Page, Scott) Date: Fri Apr 11 12:32:45 2003 Subject: [DB-SIG] displaying japanese characters from utf-8 database in a browser Message-ID: I'm not sure if this if the correct forum for this topic, but if anyone out there has any advice on how to accomplish this, it would be much appreciated. I am querying a utf-8 oracle database using the cx_oracle module (thinking of switching to DCOracle2) and trying to display the data in a browser using the Shift_JIS charset. The Japanese characters just show up as '???' though. I've tried changing the charset via the html meta tags as well as experimented with python's 'unicode' function, but no success. From andy47 at halfcooked.com Fri Apr 11 20:55:51 2003 From: andy47 at halfcooked.com (Andy Todd) Date: Fri Apr 11 14:56:07 2003 Subject: [DB-SIG] Python DB2 Module on Windows Message-ID: <3E970FB7.40000@halfcooked.com> Has anyone tried out the DB2 module (http://sourceforge.net/projects/pydb2) on Windows? I downloaded the source code but don't have Visual C++ to compile the C module. If anyone has compiled the code against Python 2.2 can you tell me what you did, or even better provide a compiled _db2 module? Thanks in advance, Andy -- ------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com From mal at lemburg.com Fri Apr 11 23:31:39 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Fri Apr 11 16:32:12 2003 Subject: [DB-SIG] Python DB2 Module on Windows In-Reply-To: <3E970FB7.40000@halfcooked.com> References: <3E970FB7.40000@halfcooked.com> Message-ID: <3E97262B.40606@lemburg.com> Andy Todd wrote: > Has anyone tried out the DB2 module > (http://sourceforge.net/projects/pydb2) on Windows? I downloaded the > source code but don't have Visual C++ to compile the C module. > > If anyone has compiled the code against Python 2.2 can you tell me what > you did, or even better provide a compiled _db2 module? Why not use ODBC ? -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 11 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 74 days left From andy47 at halfcooked.com Sat Apr 12 11:51:37 2003 From: andy47 at halfcooked.com (Andy Todd) Date: Sat Apr 12 05:51:59 2003 Subject: [DB-SIG] Python DB2 Module on Windows References: <3E970FB7.40000@halfcooked.com> <3E97262B.40606@lemburg.com> Message-ID: <3E97E1A9.3020001@halfcooked.com> M.-A. Lemburg wrote: > Andy Todd wrote: > >> Has anyone tried out the DB2 module >> (http://sourceforge.net/projects/pydb2) on Windows? I downloaded the >> source code but don't have Visual C++ to compile the C module. >> >> If anyone has compiled the code against Python 2.2 can you tell me >> what you did, or even better provide a compiled _db2 module? > > > Why not use ODBC ? > Thats my backup strategy. But it doesn't help me when we move out of concept proving and into the project proper on AIX servers. Regards, Andy -- ------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com From mal at lemburg.com Sat Apr 12 14:01:42 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Sat Apr 12 07:02:34 2003 Subject: [DB-SIG] Python DB2 Module on Windows In-Reply-To: <3E97E1A9.3020001@halfcooked.com> References: <3E970FB7.40000@halfcooked.com> <3E97262B.40606@lemburg.com> <3E97E1A9.3020001@halfcooked.com> Message-ID: <3E97F216.4050608@lemburg.com> Andy Todd wrote: > M.-A. Lemburg wrote: > >> Andy Todd wrote: >> >>> Has anyone tried out the DB2 module >>> (http://sourceforge.net/projects/pydb2) on Windows? I downloaded the >>> source code but don't have Visual C++ to compile the C module. >>> >>> If anyone has compiled the code against Python 2.2 can you tell me >>> what you did, or even better provide a compiled _db2 module? >> >> >> >> Why not use ODBC ? >> > > Thats my backup strategy. But it doesn't help me when we move out of > concept proving and into the project proper on AIX servers. Why not ? IBM DB2 ships with ODBC for AIX and mxODBC has no problem accessing DB2 on AIX either (we have a customer who does this in production). -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 12 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 73 days left From andy47 at halfcooked.com Mon Apr 14 11:48:46 2003 From: andy47 at halfcooked.com (Andy Todd) Date: Mon Apr 14 05:50:07 2003 Subject: [DB-SIG] Python DB2 Module on Windows In-Reply-To: <3E97F216.4050608@lemburg.com> References: <3E970FB7.40000@halfcooked.com> <3E97262B.40606@lemburg.com> <3E97E1A9.3020001@halfcooked.com> <3E97F216.4050608@lemburg.com> Message-ID: <20030414094844.GA1768@LATITUDE6> On Sat, Apr 12, 2003 at 01:01:42PM +0200, M.-A. Lemburg wrote: > Andy Todd wrote: > >M.-A. Lemburg wrote: > > > >>Andy Todd wrote: > >> > >>>Has anyone tried out the DB2 module > >>>(http://sourceforge.net/projects/pydb2) on Windows? I downloaded the > >>>source code but don't have Visual C++ to compile the C module. > >>> > >>>If anyone has compiled the code against Python 2.2 can you tell me > >>>what you did, or even better provide a compiled _db2 module? > >> > >> > >> > >>Why not use ODBC ? > >> > > > >Thats my backup strategy. But it doesn't help me when we move out of > >concept proving and into the project proper on AIX servers. > > Why not ? IBM DB2 ships with ODBC for AIX and mxODBC has no problem > accessing DB2 on AIX either (we have a customer who does this in > production). > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Software directly from the Source (#1, Apr 12 2003) > >>> Python/Zope Products & Consulting ... http://www.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > EuroPython 2003, Charleroi, Belgium: 73 days left > I didn't know that, thanks for the information. Regards, Andy -- -------------------------------------------------------------------------------- >From the desk of Andrew J Todd esq - http://www.halfcooked.com/ From steve_weaver at peoplesoft.com Mon Apr 14 12:12:48 2003 From: steve_weaver at peoplesoft.com (steve_weaver@peoplesoft.com) Date: Mon Apr 14 15:00:56 2003 Subject: [DB-SIG] Out of Office Response: DB-SIG Digest, Vol 1, Issue 818 Message-ID: I will be out of the office starting Monday, April 14, 2003 and will not return until Thursday, April 17, 2003. I will respond to your message when I return. From steve_weaver at peoplesoft.com Tue Apr 15 11:12:52 2003 From: steve_weaver at peoplesoft.com (steve_weaver@peoplesoft.com) Date: Tue Apr 15 13:39:41 2003 Subject: [DB-SIG] Out of Office Response: DB-SIG Digest, Vol 1, Issue 819 Message-ID: I will be out of the office starting Monday, April 14, 2003 and will not return until Thursday, April 17, 2003. I will respond to your message when I return. From Kurt.Kurniawan at rbs.org.au Wed Apr 16 11:19:25 2003 From: Kurt.Kurniawan at rbs.org.au (Kurt Kurniawan) Date: Tue Apr 15 20:22:02 2003 Subject: [DB-SIG] hello ! need help with odbc stored procedure Message-ID: hello all ! i'm playing around with PythonWin, ODBC, and stored procedures for M$ SQL Server. Could anybody point me to how accessing a stored procedure from PythonWin? The stored procedure has output parameter of binary type, how to get the value of this in Py? The stored proc has no return value. Thank's for any help. ********************************************************************************* - NOTICE - The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please notify the sender and delete the material from your computer. Internet communications are not secure. You should scan this message and any attachments for viruses. Under no circumstances do we accept liability for any loss or damage which may result from your receipt of this message or any attachments. ********************************************************************************* From nhodgson at eb2.net.au Wed Apr 16 17:33:15 2003 From: nhodgson at eb2.net.au (Neil Hodgson) Date: Wed Apr 16 02:34:31 2003 Subject: [DB-SIG] DCOracle2 selecting with "in" expression Message-ID: <3E9CF92B.4050209@eb2.net.au> We have code that uses DCOracle2 to select records where a column value is a member of a set like: select * from psptx where flag in ('A','D','M') which is currently constructed by code similar to "select * from psptx where flag in (%s)" % ",".join(listQuoted) It would be better to avoid building SQL queries up at runtime for the normal reasons including the possibility of unchecked input causing security vulnerabilities, so positional or named parameters should be used instead. Code like flagList = ('A','D','M') "select * from psptx where flag in :1", (flagList,) # or "select * from psptx where flag in (:a)", a=flagList doesn't work. Nor does creating a binding array and passing that as the argument. Does anyone have some working example code that does this? Neil From msanchez at grupoburke.com Wed Apr 16 11:36:01 2003 From: msanchez at grupoburke.com (Marcos =?ISO-8859-1?Q?S=E1nchez?= Provencio) Date: Wed Apr 16 06:36:02 2003 Subject: [DB-SIG] hello ! need help with odbc stored procedure In-Reply-To: References: Message-ID: <1050489297.6289.21.camel@cynar.proteus> ?Did you try using COM (ADO) instead of odbc? El mi?, 16 de 04 de 2003 a las 02:19, Kurt Kurniawan escribi?: > hello all ! > > i'm playing around with PythonWin, ODBC, and stored procedures for M$ > SQL Server. > Could anybody point me to how accessing a stored procedure from > PythonWin? > > The stored procedure has output parameter of binary type, how to get > the value of this in Py? The stored proc has no return value. > > Thank's for any help. > > > > ********************************************************************************* > - NOTICE - > The information transmitted is intended only for the person or entity > to which it is addressed and may contain confidential and/or > privileged > material. Any review, retransmission, dissemination or other use of, > or taking of any action in reliance upon, this information by persons > or entities other than the intended recipient is prohibited. If you > have received this email in error, please notify the sender and delete > the material from your computer. > > Internet communications are not secure. You should scan this message > and any attachments for viruses. Under no circumstances do we accept > liability for any loss or damage which may result from your receipt of > > this message or any attachments. > ********************************************************************************* > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig -- gpg --recv-keys --keyserver wwwkeys.pgp.net B9AD9B1B -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/db-sig/attachments/20030416/24e95303/attachment.bin From steve_weaver at peoplesoft.com Wed Apr 16 10:12:46 2003 From: steve_weaver at peoplesoft.com (steve_weaver@peoplesoft.com) Date: Wed Apr 16 12:17:29 2003 Subject: [DB-SIG] Out of Office Response: DB-SIG Digest, Vol 1, Issue 820 Message-ID: I will be out of the office starting Monday, April 14, 2003 and will not return until Thursday, April 17, 2003. I will respond to your message when I return. From dieter at handshake.de Wed Apr 16 22:14:52 2003 From: dieter at handshake.de (Dieter Maurer) Date: Wed Apr 16 19:26:40 2003 Subject: [DB-SIG] DCOracle2 selecting with "in" expression In-Reply-To: <3E9CF92B.4050209@eb2.net.au> References: <3E9CF92B.4050209@eb2.net.au> Message-ID: <16029.43948.256401.636928@gargle.gargle.HOWL> Neil Hodgson wrote at 2003-4-16 16:33 +1000: > We have code that uses DCOracle2 to select records where a column > value is a member of a set like: > > select * from psptx where flag in ('A','D','M') You can use the "dtml-sqltest" tag with the "multiple" attribute. Dieter From wichert at wiggy.net Thu Apr 17 19:18:03 2003 From: wichert at wiggy.net (Wichert Akkerman) Date: Thu Apr 17 12:19:16 2003 Subject: [DB-SIG] Problem with exception classes Message-ID: <20030417161803.GX22848@wiggy.net> I've been using DB-API2 for a while now but have run into a few issues with respect to portability between different SQL backends. One of those is the paramstyle, which I'm happy to see might be addressed in DB-API3. However issue I ran into is exception classes: a lot of my code is passed a database connectino or a cursor and does not know which backend it is attached to. However since DB-API2 species that exception types can only be accesses directly from the driver module that means I can not perform any exception handling. At the moment I work around this by using a wrapper that copies the exception classes into the connection instance (inspired by the MySQLdb module, which does that as well). Is that something that would be useful to add to DB-API3 as well? Wichert. -- Wichert Akkerman http://www.wiggy.net/ A random hacker From jacobs at penguin.theopalgroup.com Thu Apr 17 14:18:38 2003 From: jacobs at penguin.theopalgroup.com (Kevin Jacobs) Date: Thu Apr 17 13:19:11 2003 Subject: [DB-SIG] Problem with exception classes In-Reply-To: <20030417161803.GX22848@wiggy.net> Message-ID: On Thu, 17 Apr 2003, Wichert Akkerman wrote: > I've been using DB-API2 for a while now but have run into a few issues > with respect to portability between different SQL backends. One of those > is the paramstyle, which I'm happy to see might be addressed in DB-API3. > > However issue I ran into is exception classes: a lot of my code is > passed a database connectino or a cursor and does not know which backend > it is attached to. However since DB-API2 species that exception types > can only be accesses directly from the driver module that means I can > not perform any exception handling. At the moment I work around this > by using a wrapper that copies the exception classes into the connection > instance (inspired by the MySQLdb module, which does that as well). > > Is that something that would be useful to add to DB-API3 as well? I use a trick to virtualize the database exceptions so that I can catch them without knowing which backend they come from. 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 dbapi_exceptions = [ 'Warning', 'Error', 'InterfaceError', 'DatabaseError', 'DataError', 'OperationalError', 'IntegrityError', 'InternalError', 'ProgrammingError', 'NotSupportedError' ] def __import_exceptions(module): for e in dbapi_exceptions: sub_exception = getattr(module, e) global_exception = globals()[e] sub_exception.__bases__ += (global_exception,) import MySQLdb import pgSQL __import_exceptions(MySQLdb) __import_exceptions(pgSQL) try: function_that_calls_into_a_registered_module() except DataError: pass -Kevin -- -- Kevin Jacobs The OPAL Group - Enterprise Systems Architect Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com Fax: (216) 986-0714 WWW: http://www.theopalgroup.com From mal at lemburg.com Thu Apr 17 20:22:26 2003 From: mal at lemburg.com (M.-A. Lemburg) Date: Thu Apr 17 13:23:09 2003 Subject: [DB-SIG] Problem with exception classes In-Reply-To: <20030417161803.GX22848@wiggy.net> References: <20030417161803.GX22848@wiggy.net> Message-ID: <3E9EE2D2.7090603@lemburg.com> Wichert Akkerman wrote: > I've been using DB-API2 for a while now but have run into a few issues > with respect to portability between different SQL backends. One of those > is the paramstyle, which I'm happy to see might be addressed in DB-API3. > > However issue I ran into is exception classes: a lot of my code is > passed a database connectino or a cursor and does not know which backend > it is attached to. However since DB-API2 species that exception types > can only be accesses directly from the driver module that means I can > not perform any exception handling. At the moment I work around this > by using a wrapper that copies the exception classes into the connection > instance (inspired by the MySQLdb module, which does that as well). > > Is that something that would be useful to add to DB-API3 as well? I guess this would be possible :-) FWIW, mxODBC is exposing the exception objects on the connection objects as well and it also provides a .connection attribute on cursors, so passing around cursors still let's you use exception handling. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 17 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 68 days left From wichert at wiggy.net Thu Apr 17 20:39:40 2003 From: wichert at wiggy.net (Wichert Akkerman) Date: Thu Apr 17 13:39:47 2003 Subject: [DB-SIG] Problem with exception classes In-Reply-To: <3E9EE2D2.7090603@lemburg.com> References: <20030417161803.GX22848@wiggy.net> <3E9EE2D2.7090603@lemburg.com> Message-ID: <20030417173940.GB22848@wiggy.net> Previously M.-A. Lemburg wrote: > FWIW, mxODBC is exposing the exception > objects on the connection objects as well and it also provides > a .connection attribute on cursors, so passing around cursors > still let's you use exception handling. Good point; at the moment I am not working with large data sets and not passing cursors around, so I didn't think of adding something to a cursor instange. But if you do pass cursors around you need to be able to get the exception types from the cursor as well. Wichert. -- Wichert Akkerman http://www.wiggy.net/ A random hacker From wichert at wiggy.net Thu Apr 17 20:38:00 2003 From: wichert at wiggy.net (Wichert Akkerman) Date: Thu Apr 17 14:05:47 2003 Subject: [DB-SIG] Problem with exception classes In-Reply-To: References: <20030417161803.GX22848@wiggy.net> Message-ID: <20030417173800.GA22848@wiggy.net> Previously Kevin Jacobs wrote: > I use a trick to virtualize the database exceptions so that I can catch them > without knowing which backend they come from. Nice trick; you basically use a common module which all SQL using modules can import which defines the exception classes. I'm not sure if that is workable for a DB-API though, since nothing exists to provide that common module which defines the exception types. Wichert. -- Wichert Akkerman http://www.wiggy.net/ A random hacker From jacobs at penguin.theopalgroup.com Thu Apr 17 17:26:58 2003 From: jacobs at penguin.theopalgroup.com (Kevin Jacobs) Date: Thu Apr 17 16:27:32 2003 Subject: [DB-SIG] Problem with exception classes In-Reply-To: <20030417173800.GA22848@wiggy.net> Message-ID: On Thu, 17 Apr 2003, Wichert Akkerman wrote: > Previously Kevin Jacobs wrote: > > I use a trick to virtualize the database exceptions so that I can catch them > > without knowing which backend they come from. > > Nice trick; you basically use a common module which all SQL using > modules can import which defines the exception classes. I'm not > sure if that is workable for a DB-API though, since nothing exists > to provide that common module which defines the exception > types. True, but it works just fine for my own database abstraction layer and does not require altering the DB-API specification. -Kevin -- -- Kevin Jacobs The OPAL Group - Enterprise Systems Architect Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com Fax: (216) 986-0714 WWW: http://www.theopalgroup.com From wichert at wiggy.net Thu Apr 17 23:33:35 2003 From: wichert at wiggy.net (Wichert Akkerman) Date: Thu Apr 17 16:33:38 2003 Subject: [DB-SIG] Problem with exception classes In-Reply-To: References: <20030417173800.GA22848@wiggy.net> Message-ID: <20030417203335.GC22848@wiggy.net> Previously Kevin Jacobs wrote: > True, but it works just fine for my own database abstraction layer and does > not require altering the DB-API specification. So does my own wrapper (http://svn.wiggy.net/repository/python-dhm/src/sqlwrap.py in case anyone is interested). However since there is an interested in making a DB-API3 I think it would be nice to fix this there. Wichert. -- Wichert Akkerman http://www.wiggy.net/ A random hacker From plusk at radford.edu Fri Apr 18 01:59:37 2003 From: plusk at radford.edu (Paul D. Lusk) Date: Thu Apr 17 21:00:29 2003 Subject: [DB-SIG] DCOracle 2 question - Ints vs. Floats Message-ID: 'select 1.1 as thing from dual' gives me a description of ('THING','NUMBER',3,3,0,0,1) while 'select 11 as thing from dual' gives me a description of ('THING','NUMBER',2,2,0,0,1) Is there any way of telling one is a float and the other is an int without retrieving a row? Paul From jno at glasnet.ru Fri Apr 18 13:38:42 2003 From: jno at glasnet.ru (jno) Date: Fri Apr 18 04:39:25 2003 Subject: [DB-SIG] DCOracle 2 question - Ints vs. Floats In-Reply-To: References: Message-ID: <3E9FB992.4090301@glasnet.ru> how about the common trick select * from The_Table where 1=0 ?? Paul D. Lusk wrote: > 'select 1.1 as thing from dual' > > gives me a description of > ('THING','NUMBER',3,3,0,0,1) > > while > > 'select 11 as thing from dual' > > gives me a description of > ('THING','NUMBER',2,2,0,0,1) > > Is there any way of telling one is a float and the other is an int > without retrieving a row? > > Paul > > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://mail.python.org/mailman/listinfo/db-sig -- -- jno, a ROL techie (PRIVATE PERSON) http://www.aviation.ru/ http://www.glasnet.ru/~jno From g_a_l_l_a at mail333.com Fri Apr 18 10:15:36 2003 From: g_a_l_l_a at mail333.com (g_a_l_l_a@mail333.com) Date: Fri Apr 18 05:15:38 2003 Subject: [DB-SIG] 0027805590-ID: We are glad to inform you about the changes in our website Message-ID: <2003.04.18.2059127E4CD45FA4@mail333.com> Dear Sir or Madam, We are glad to inform you about the changes in our website http://www.gallery-a.ru. Now you can get to know the price for the paintings in our gallery without filling the order form. Also, we have new works of Utkin Alexandr, Belonog Anatoly and other painters. Soon there will be pages of new painters and new section of free wallpapers and screensavers. Welcome to our website! Gallery-a curator. Sorry if that information not interesting for You and we disturb You with our message! For removing yor address from this mailing list just replay this message with word 'unsubscribe' in subject field or simple click this link: http://www.gallery-a.ru/unsubscribe.php?e=ZGItc2lnQHB5dGhvbi5vcmc6MTY4MDA0MTQ= From vishnu_mahendra at yahoo.com Sun Apr 20 07:57:20 2003 From: vishnu_mahendra at yahoo.com (vishnu mahendra) Date: Sun Apr 20 22:54:17 2003 Subject: [DB-SIG] python-oracle queries Message-ID: <20030420135720.99776.qmail@web40807.mail.yahoo.com> sir, i have connected to oracle from python through odbc in windows. i dont know how do i execute procedures and functions in through odbc. can we pass parameters in queries? can we access results of a query by fieldnames? how can we change date format so that we can store and retrieve date in '03-aug-03' format. thank you in advance, vishnu __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com From bgailer at alum.rpi.edu Mon Apr 21 10:25:23 2003 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Mon Apr 21 11:25:32 2003 Subject: [DB-SIG] python-oracle queries In-Reply-To: <20030420135720.99776.qmail@web40807.mail.yahoo.com> Message-ID: <5.2.0.9.0.20030421085819.02fb2618@66.28.54.253> At 06:57 AM 4/20/2003 -0700, vishnu mahendra wrote: >Oracle: I use cxOracle instead of ODBC; here's some of my wrapper class: import cx_Oracle class Oracle: def __init__(self, conn_str): self.conn_str = conn_str self.conn = cx_Oracle.connect(self.conn_str) self.c = self.conn.cursor() def setp(self, pm): if pm: self.out_names = [p[0] for p in pm] list = [p[0] + ' = ' + p[1] for p in pm] pl = 'self.c.setinputsizes(' + ', '.join(list) + ')' return eval(pl) else: self.out_names = [] return {} def exp(self, st, outparm = [], **indict): ## ex, adding parameters self.outparms = self.setp(outparm) self.c.execute(st, **indict) return self.getp() def getp(self): # return out parameter values return [self.outparms[pn].getvalue() for pn in self.out_names] def select(self, st, **indict): # ex select statement; fetch results try:self.c.execute(st, **indict) except cx_Oracle.DatabaseError:return traceback.format_exception_only(sys.exc_info()[0],sys.exc_info()[1]) return self.c.fetchall() conn - Oracle('asdf/asdf@asdf') >how do I execute procedures and functions x = conn.exp("declare p number; begin :p := 3; end;", [['p','cx_Oracle.NUMBER']]) It has been a while since I've worked with this code, so I'm not 100% sure of it,but I think with a little fiddling you could get it to work. >can we pass parameters in queries? sql = "select * from PER_PERSON_ANALYSES where person_id = :p1 and id_flex_num = :p2 " x = conn.select(sql, person_id, id_flex_num) I think that x now is a list of result rows. >can we access results of a query by fieldnames? You'd have to create your own map. >how can we change date format so that we can store and retrieve date in >'03-aug-03' format. I think you can use the oracle DATE function to convert date formats. Bob Gailer bgailer@alum.rpi.edu 303 442 2625 -------------- next part -------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003 From vishnu_mahendra at yahoo.com Fri Apr 25 09:43:39 2003 From: vishnu_mahendra at yahoo.com (vishnu mahendra) Date: Fri Apr 25 11:44:21 2003 Subject: [DB-SIG] printing(hardcopy) error in python in windows Message-ID: <20030425154339.40322.qmail@web40805.mail.yahoo.com> sir, can you help me to print a hard copy. i am using python2.0 in win32 using dot matrix as my default printer.i have pythonwin too. i searched and i got something simillar to printing but --------------------------------------- import win32print def rawprint(data="hai",jobname='TEST DOC',printerName=None): if printerName==None: printerName=win32print.GetDefaultPrinter() print printerName printerHandle=win32print.OpenPrinter(printerName) print printerHandle printJob=win32print.StartDocPrinter(printerHandle,1,(jobname,None,None)) print printJob win32print.WritePrinter(printerHandle,data) win32print.EndDocPrinter(printerHandle) win32print.ClosePrinter(printerHandle) rawprint() ---------------------------------------- error: Epson LX-300 4304748 Traceback (innermost last): File "d:/pro/printerfun.py", line 13, in ? rawprint() File "d:/pro/printerfun.py", line 8, in rawprint printJob=win32print.StartDocPrinter(printerHandle,1,(jobname,None,None)) AttributeError: StartDocPrinter i also gone through pythonwin help and i found PyCPrintInfo Object. i tried my best, i have not found how to use that object.please help me. thank you in advance, vishnu __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com From djc at object-craft.com.au Sun Apr 27 13:14:29 2003 From: djc at object-craft.com.au (Dave Cole) Date: Sun Apr 27 08:14:31 2003 Subject: [DB-SIG] Sybase module 0.36 released Message-ID: WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: This is another incremental improvement to FreeTDS support. You can build for FreeTDS like this: python setup.py build_ext -D HAVE_FREETDS -U WANT_BULKCOPY python setup.py install If you are using FreeTDS 0.60 or 0.61 change the compile command to: python setup.py build_ext -D HAVE_FREETDS=60 -U WANT_BULKCOPY or python setup.py build_ext -D HAVE_FREETDS=61 -U WANT_BULKCOPY The module is available here: http://www.object-craft.com.au/projects/sybase/download/sybase-0.36.tar.gz The module home page is here: http://www.object-craft.com.au/projects/sybase/ CHANGES SINCE 0.36pre6: * Output parameters from stored procedures are supported via the OUTPUT() function. The parameter to OUTPUT() determines the type and size of the buffer which will be allocated to receive the output value. c.callproc('test_proc', {'@type': 'business', '@tot_sales': 5, '@num_books': Sybase.OUTPUT(1)}) * Added Time() and TimeFromTicks() DB API functions. * Fixed fmx.maxlength typo. * Reorganised result fetching to use "fetcher" classes; _FetchNow, _FetchNowParams, and _FetchLazy. This was in response to testing against the Python DB API 2.0 Anal Compliance Unit Test. CHANGES SINCE 0.35: * Fixed bug in ctx.c:ct_con_drop() which caused SEGFAULT with FreeTDS. * Export version of FreeTDS used in sybasect.__have_freetds__ * Set Sybase._ctx as the global context soon as in Sybase.py to avoid problems with undefined global ctx. * Look for SYBASE_OCS on all platforms. * Fixed spelling error in ctx.c:global_ctx(). * Fixed cursor locking bug with .nextset() method. * Added .debug_msg() method to context type which writes to the debug log when debugging is enabled for the context object. * Merged AIX build changes from Dietmar Rothkamp. * Now compiles with FreeTDS 0.61. * Limit size of TEXT fields to 65536. * Removed references to CS_PENDING and CS_BUSY in Sybase.py. * Bind CS_VARBINARY_TYPE as CS_BINARY_TYPE. * Do not attempt to ct_cancel() when handling an exception if have not connected to the server. Bug fix in Sybase.py. * Seems like FreeTDS reports the wrong maxlength in ct_describe() for CS_NUMERIC_TYPE and CS_DECIMAL_TYPE. Ignore FreeTDS and assume a maxlength of sizeof(CS_NUMERIC). Bugfix in databuf.c. * Use correct T_STRING_INPLACE type in structure member descriptions. The code does not use Python API for these members. * Debug output for DataFmt now includes scale and precision. * More definitions added to freetds.h; CS_SRC_VALUE, CS_CLEAR. -- http://www.object-craft.com.au From henrik.ekelund at vpd.se Wed Apr 30 19:35:35 2003 From: henrik.ekelund at vpd.se (Henrik Ekelund) Date: Wed Apr 30 12:35:38 2003 Subject: [DB-SIG] ANN: adodbapi 2.0 Message-ID: NAME: adodbapi - A python DB API 2.0 interface to Microsoft ADO DESCRIPTION: A 100% Python-DB API 2.0 compliant module that makes it easy to use Microsoft ADO for connecting with databases and other data sources. Includes pyunit testcases. WHATS NEW: 1. Improved performance through GetRows method. 2. Flexible date conversions. Supports eGenix mxExtensions, python time module and python 2.3 datetime module. 3. More exact mappings of numeric datatypes. 4. User defined conversions of datatypes through "plug-ins". 5. Improved testcases, not dependent on Northwind data. 6. Works with Microsoft Access currency datatype. 7. Improved DB-API 2.0 compliance. 8. rowcount property works on statements Not returning records. 9. "Optional" error handling extension, see DB-API 2.0 specification. 10. Two maling lists have been created, one for users and one for developers. PLATFORM: Windows only HOMEPAGE: LICENSE: Lesser GPL (fine for most commercial vendors) Henrik Ekelund ********************************************************************** This email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************