From gstein@lyra.org Fri Jun 16 08:36:08 2000 From: gstein@lyra.org (Greg Stein) Date: Fri, 16 Jun 2000 00:36:08 -0700 Subject: [DB-SIG] [jpaint@real.com: Re: [ViewCVS] cvsdb problems - AttributeError: Timestamp] Message-ID: <20000616003608.A29590@lyra.org> Comments? Does MySQLdb *require* mxDateTime? Cheers, -g ----- Forwarded message from Jay Painter ----- Date: Thu, 15 Jun 2000 21:26:10 -0700 (PDT) From: Jay Painter To: Gabriel Belinsky cc: viewcvs@lyra.org Subject: Re: [ViewCVS] cvsdb problems - AttributeError: Timestamp Ug. According to the DBI 2.0 spec, those functions are suppose to be required, and MySQLdb should be suppling it's own versions if mxDateTime isn't installed. Bummer. I'll have to impliment fallbacks. --- Jay Painter // RealNetworks, Inc. On Thu, 15 Jun 2000, Gabriel Belinsky wrote: > I just ran into this starting with fresh installs of Python 1.52, > MySQL 3.22.32, MySQLdb 0.2.1 and ViewCVS 0.5. > > I found this in the MySQLdb docs: > file: MySQLdb-0.2.1/doc/MySQLdb-1.html > > 1.4 DateTime > > If you have the DateTime module installed (recommended), MySQLdb > will use it for date-related objects. Otherwise, these will be > returned to Python as strings. You can also modify the type > conversion dictionaries to return these as other object classes, > if you prefer. > > The correct pointer the the DateTime module is: > http://starship.python.net/~lemburg/mxDateTime.html > > In fact, without that library MySQLdb 0.2.1 doesn't implement the Timestamp > method. > > gabe. > > > Jay Painter jpaint@real.com > Fri, 9 Jun 2000 16:00:43 -0700 (PDT) > > I've seen this error -- I wonder what's going on, the DBI 2.0 API > specificly requires the Timestamp method. Can you do a import MySQLdb; > dir(MySQLdb) and send me the results? > > I'll probably have to download the newest MySQLdb and compile it. The > 1.12 version I have used on multiple machines works. > > --- > Jay Painter // RealNetworks, Inc. > > On Fri, 9 Jun 2000, Ford, Toby wrote: > > > > > I noticed that someone else had the same > > problem as I in the archive but no resolution was > > listed. > > > > [root@tford11 viewcvs]# ./cvsdbadmin rebuild /home/cvsroot > > [/home/cvsroot/CVSROOT/loginfo,v[1 commits]] > > Traceback (innermost last): > > File "./cvsdbadmin", line 156, in ? > > commandFunction() > > File "./cvsdbadmin", line 123, in CommandRebuild > > RecurseRebuild(db, repository, repository) > > File "./cvsdbadmin", line 111, in RecurseRebuild > > RecurseRebuild(db, repository, path) > > File "./cvsdbadmin", line 116, in RecurseRebuild > > RebuildFile(db, repository, path) > > File "./cvsdbadmin", line 97, in RebuildFile > > db.AddCommit(commit) > > File "/opt/viewcvs/lib/database.py", line 242, in AddCommit > > dbCI_When = DBI.Timestamp( > > AttributeError: Timestamp > > [root@tford11 viewcvs]# python > > Python 1.5.2 (#1, Feb 1 2000, 16:32:16) [GCC egcs-2.91.66 19990314/Linux > > (egcs > > - on linux-i386 > > Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam > > >>> import MySQLdb > > >>> MySQLdb.__version__ > > '1.24' > > >>> > > [root@tford11 viewcvs]# mysqlshow -p":-)" ViewCVS > > Database: ViewCVS > > +--------------+ > > | Tables | > > +--------------+ > > | branches | > > | checkins | > > | descs | > > | dirs | > > | files | > > | people | > > | repositories | > > | tags | > > +--------------+ > > [root@tford11 viewcvs]# mysql --version > > mysql Ver 10.4 Distrib 3.23.14-alpha, for pc-linux-gnu (i686) > > > > > > Toby Ford > > USi > > > > _______________________________________________ > > viewcvs mailing list > > viewcvs@lyra.org > > http://mailman.lyra.org/mailman/listinfo/viewcvs > > > > _______________________________________________ > viewcvs mailing list > viewcvs@lyra.org > http://mailman.lyra.org/mailman/listinfo/viewcvs > _______________________________________________ viewcvs mailing list viewcvs@lyra.org http://mailman.lyra.org/mailman/listinfo/viewcvs ----- End forwarded message ----- -- Greg Stein, http://www.lyra.org/ From Phyllis@simplex.com Fri Jun 16 20:24:29 2000 From: Phyllis@simplex.com (Phyllis Metzger) Date: Fri, 16 Jun 2000 12:24:29 -0700 Subject: [DB-SIG] Profitable Pre-IPO needs Python Message-ID: <394A7EED.933C94B9@simplex.com> Thank you in Advance! About the company: Profitable 5 yr. old Pre-IPO software development company developing tools for the EDA market. Phenomenal Management Team and Board of Directors made up of prominent Leaders from Cadence, Synopsys, Avanti! Please respond to this email if you are interested in this opportunity. Database Developer Software developer with a very strong C++ background to develop a proprietary database for our VLSI analysis tools. Design data structures involving billions of objects in a way that optimizes rapid information retrieval, memory management, and file access. Requires expertise in C++, Unix or NT, data manipulation, data paging, file management; experience with persistent data. Experience with threads, Python, or wxWindows a plus. -- Phyllis Metzger Simplex Solutions 521 Almanor Av. Sunnyvale, CA 94086 Email Phyllis@simplex www.simplex.com 408-617-6128 From cujdc@pen.eiu.edu Mon Jun 19 17:15:53 2000 From: cujdc@pen.eiu.edu (Josh) Date: Mon, 19 Jun 2000 11:15:53 -0500 Subject: [DB-SIG] Stored Procedure problem Message-ID: <002201bfda09$a5453400$1301000a@PIII533> This is a multi-part message in MIME format. ------=_NextPart_000_001F_01BFD9DF.BB60A230 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I am trying to call a stored procedure from a sample database = (NorthWind) that came with MSDE. I am using SQL Server 7.0. Here is = what I am trying... -------- import dbi import odbc myconn =3D odbc.odbc("SQLTEST") #SQLTEST is the alias myc =3D myconn.cursor() # this all seems to work, the next statement does not myc.execute("EXEC CustOrderHist('ALFKI')")=20 ------- the interpreter tells me that there was an odbc error close to ALFKI. = CustOrderHist expects a 5 character string and ALFKI is a valid customer = id. Here is the error... [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax = near 'ALFKI' Please let me know if you have any information why this is not working. Thanks, Josh Castagno ------=_NextPart_000_001F_01BFD9DF.BB60A230 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello, I am trying to call a stored = procedure from=20 a sample database (NorthWind) that came with MSDE.  I am using SQL = Server=20 7.0.  Here is what I am trying...
--------
import dbi
import odbc
myconn =3D odbc.odbc("SQLTEST") = #SQLTEST is the=20 alias
myc =3D myconn.cursor()
 
# this all seems to work, the next = statement does=20 not
 
myc.execute("EXEC=20 CustOrderHist('ALFKI')") =
-------
the interpreter tells me that there was = an odbc=20 error close to ALFKI.  = CustOrderHist expects=20 a 5 character string and ALFKI is a valid customer id.  Here = is the=20 error...
 
[Microsoft][ODBC SQL Server = Driver][SQL=20 Server]Line 1: Incorrect syntax near 'ALFKI'
 
Please let me know if you have any = information why=20 this is not working.
 
Thanks,
Josh=20 Castagno
------=_NextPart_000_001F_01BFD9DF.BB60A230-- From died9501@uidaho.edu Mon Jun 19 18:38:56 2000 From: died9501@uidaho.edu (Karl Thomas Diedrich) Date: Mon, 19 Jun 2000 10:38:56 -0700 (PDT) Subject: [DB-SIG] postgresql-python return type Message-ID: Hello, I am using postgresql-python and pygnome to write an application. I am having troubles dispaying the results of queries with pygnome. I wanted to know if anyone knew how to do this or where to look. The data type of the results of queries is . targetSearchResult = self.cnx.query( """SELECT description, accession, start, targetSeq, target.name, mismatch, oligoSeq FROM target, oligo WHERE description LIKE '%""" + keyword + """%' AND target.name = oligo.name ORDER BY mismatch DESC;""" ) type(tagetSearchResult) = I can display the value(query results) of the object with the print command print targetSearchResult I tried formatting it as a string but I get the object type name instead of the value format = '%s' results = format % (targetSearchResult) print reults = Thanks, Karl Karl Diedrich died9501@uidaho.edu http://www.uidaho.edu/~died9501/ University of Idaho Environmental Biotechnology Institute University of Idaho Food Research Center 103 Moscow, ID 83844-1052 From eric@mixadlive.com Tue Jun 20 01:48:03 2000 From: eric@mixadlive.com (Eric Bianchi) Date: Tue, 20 Jun 2000 00:48:03 +0000 Subject: [DB-SIG] PoPy 1.2 In-Reply-To: <20000526105316.A470@arioch>; from eric@mixadlive.com on Fri, May 26, 2000 at 10:53:19 +0000 References: <20000526105316.A470@arioch> Message-ID: <20000620004803.B11388@arioch> PoPy is a driver for PostgreSQL v6.5 and v7.0 to use with Python. It is DB API v2.0 compliant, and supports level-1 thread safety PoPy is a Python driver for PostgreSQL v6.5 and v7.0 Right now, the driver includes : 1.Full support of the DB API v2.0 2.Support for large objects and date objects 3.External and internal database procedure call 4.Thread safety level 1 Licence : GPL You can get it at http://www.mixadlive.com comments and feedback are welcome regards the PoPy team From mal@lemburg.com Tue Jun 20 10:06:04 2000 From: mal@lemburg.com (M.-A. Lemburg) Date: Tue, 20 Jun 2000 11:06:04 +0200 Subject: [DB-SIG] PoPy 1.2 References: <20000526105316.A470@arioch> <20000620004803.B11388@arioch> Message-ID: <394F33FC.6A090AE2@lemburg.com> Eric Bianchi wrote: > > PoPy is a driver for PostgreSQL v6.5 and v7.0 to use > with Python. It is DB API v2.0 compliant, and supports level-1 thread > safety > > PoPy is a Python driver for PostgreSQL v6.5 and v7.0 > Right now, the driver includes : > > 1.Full support of the DB API v2.0 > 2.Support for large objects and date objects > 3.External and internal database procedure call > 4.Thread safety level 1 > > Licence : GPL Just a note for potential users: Using this module will put your whole project under the terms of the GPL. I would suggest using LGPL as a license for anything which is mainly used a library, since LGPL only protects the library and doesn't harm the license of "greater works" using it. > You can get it at http://www.mixadlive.com > > comments and feedback are welcome > > regards > > the PoPy team > > _______________________________________________ > DB-SIG maillist - DB-SIG@python.org > http://www.python.org/mailman/listinfo/db-sig -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/ From darcy@druid.net Tue Jun 20 12:54:50 2000 From: darcy@druid.net (D'Arcy J.M. Cain) Date: Tue, 20 Jun 2000 07:54:50 -0400 (EDT) Subject: [DB-SIG] PoPy 1.2 In-Reply-To: <394F33FC.6A090AE2@lemburg.com> "from M.-A. Lemburg at Jun 20, 2000 11:06:04 am" Message-ID: Thus spake M.-A. Lemburg > Just a note for potential users: > Using this module will put your whole project under the terms > of the GPL. > > I would suggest using LGPL as a license for anything which > is mainly used a library, since LGPL only protects the > library and doesn't harm the license of "greater works" > using it. Or just continue to use PyGreSQL which has the same basic license as both Python and PostgreSQL. Hopefully we will soon start the big cleanup and get 3.1 out soon but the current version is quite usable as it is. It is also in the PostgreSQL tree. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. From eric@mixadlive.com Tue Jun 20 17:46:19 2000 From: eric@mixadlive.com (Eric Bianchi) Date: Tue, 20 Jun 2000 16:46:19 +0000 Subject: [DB-SIG] PoPy Licence Message-ID: <20000620164619.C12248@arioch> Dear PoPy and zpopyda users, there has been a lot of discussion lately concerning the GPL issue of PoPy on zope mailing list, python mailing list and even in the Mixadlive itself. We have been thinking a lot since there. On one hand, we are very concerned about using and developing free software available for the community, on the other hand, we want to provide the best product for our user and give them the availability to enjoy popy as much as we do without having licence issue, that's free software... We have developed PoPy to work faster and cleaner and since we are using it, our work get easier than ever. That's why we have chosen to modify licences of PoPy and zpopyda and put them under the LGPL licence. We hope you'll enjoy that for comments and questions please use our mailing list : popy-user@lists.mixadlive.com Regards the PoPy team From herb@dolphinsearch.com Wed Jun 21 09:33:25 2000 From: herb@dolphinsearch.com (Herbert L. Roitblat) Date: Tue, 20 Jun 2000 22:33:25 -1000 Subject: [DB-SIG] Lotus Notes Message-ID: <035401bfdb5b$5e48cf00$8fd6afcf@pixi.com> Folks, Does anyone have any suggestions about interfacing with Lotus Notes? I know very little about Notes, but quite a bit about Python. Thanks for any pointers, Herb From mal@lemburg.com Wed Jun 21 10:05:18 2000 From: mal@lemburg.com (M.-A. Lemburg) Date: Wed, 21 Jun 2000 11:05:18 +0200 Subject: [DB-SIG] Lotus Notes References: <035401bfdb5b$5e48cf00$8fd6afcf@pixi.com> Message-ID: <3950854E.3A494900@lemburg.com> "Herbert L. Roitblat" wrote: > > Folks, > Does anyone have any suggestions about interfacing with Lotus Notes? I know > very little about Notes, but quite a bit about Python. There are at least two ways to interface to Notes: either through the COM interface or via the optional ODBC interface available for Notes. I don't have any experience using either method but IIRC there have been reports that interfacing Python -> Notes does work this way (check dejanews). -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/ From lhonda@zip.net Wed Jun 21 14:50:03 2000 From: lhonda@zip.net (Luiz Tadao Honda) Date: Wed, 21 Jun 2000 10:50:03 -0300 Subject: [DB-SIG] DCOracle - prepare samples needed. Message-ID: <036401bfdb87$9a149010$1ce8f5c8@itanet.com.br> Hi, I trying to prepare a query with input parameters like: sql='select name from user where id=:p1' to let Oracle make the execution plan only once and then substitute the variable p1 with the real values. Does anyone have some samples to help me? Thanks. Regards Luiz Honda From jonan-lists-python-db@callisia.com Sat Jun 24 00:05:46 2000 From: jonan-lists-python-db@callisia.com (jonan-lists-python-db@callisia.com) Date: Fri, 23 Jun 2000 19:05:46 -0400 Subject: [DB-SIG] DB API 2.0 - dictionary fetch ? Message-ID: <20000623190546.B2857@sindri.callisia.com> Hello, I am wondering if the 2.0 db api provides a method for returning a dictionary of results instead of a list ? Something like perl-DBI's fetch_hashref . I am using the latest MySQLdb and it mentions a fetchalldict method in the tutor examples, though the method is non-existant when put to use. The source MySQLdb.py has comment of fetchXXX depracated just above the fetchalldict, so is it gone ? The very sparse documentation and db api spec also mention different cursor classes which maybe is the way to do it ? Im using my own function to make the dictionary but it would be nice if it was in the API. Thanks, -- -Jonan Santiago -Callisia Communications -http://www.callisia.com From gstein@lyra.org Sat Jun 24 02:53:25 2000 From: gstein@lyra.org (Greg Stein) Date: Fri, 23 Jun 2000 18:53:25 -0700 Subject: [DB-SIG] DB API 2.0 - dictionary fetch ? In-Reply-To: <20000623190546.B2857@sindri.callisia.com>; from jonan-lists-python-db@callisia.com on Fri, Jun 23, 2000 at 07:05:46PM -0400 References: <20000623190546.B2857@sindri.callisia.com> Message-ID: <20000623185325.G29590@lyra.org> On Fri, Jun 23, 2000 at 07:05:46PM -0400, jonan-lists-python-db@callisia.com wrote: > Hello, > > I am wondering if the 2.0 db api provides a method for returning > a dictionary of results instead of a list ? Something like > perl-DBI's fetch_hashref . > > I am using the latest MySQLdb and it mentions a fetchalldict method > in the tutor examples, though the method is non-existant when put > to use. The source MySQLdb.py has comment of fetchXXX depracated > just above the fetchalldict, so is it gone ? > > The very sparse documentation and db api spec also mention different > cursor classes which maybe is the way to do it ? Im using > my own function to make the dictionary but it would be nice > if it was in the API. Fetching a dictionary is not part of the API because it is so easy to put that into the Python code. Making it part of the API would just increase the burden for people to build a DBAPI interface. [ although, current implementation style has used a small C code base plus a higher-level Python interface; presuming that really becomes "typical" then we could mandate the dict interface since most DBAPI modules could just do that in their Python portion... ] In any case... it isn't a standard part of the DBAPI interface. There was a call for tools a while back that was pretty much a non-starter. But whatever the case, I posted a module that has been around since 1996 to provide a dict-like interface. See the info at: http://www.python.org/pipermail/db-sig/2000-April/002329.html Cheers, -g -- Greg Stein, http://www.lyra.org/ From darcy@druid.net Sat Jun 24 14:22:28 2000 From: darcy@druid.net (D'Arcy J.M. Cain) Date: Sat, 24 Jun 2000 09:22:28 -0400 (EDT) Subject: [DB-SIG] DB API 2.0 - dictionary fetch ? In-Reply-To: <20000623190546.B2857@sindri.callisia.com> "from jonan-lists-python-db@callisia.com at Jun 23, 2000 07:05:46 pm" Message-ID: Thus spake jonan-lists-python-db@callisia.com > I am wondering if the 2.0 db api provides a method for returning > a dictionary of results instead of a list ? Something like > perl-DBI's fetch_hashref . No but PyGreSQL 3.0 (http://www.druid.net/pygresql/) has two modules, DB API and Classic. The classic module uses a completely different interface to the database (PostgreSQL only) which includes returning dictionaries and lists of dictionaries. Very convenient for certain tasks. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. From tbryan@starship.beopen.com Thu Jun 29 02:38:30 2000 From: tbryan@starship.beopen.com (Tom Bryan) Date: Wed, 28 Jun 2000 18:38:30 -0700 (PDT) Subject: [DB-SIG] OO wrapper for SQL? In-Reply-To: Message-ID: On Tue, 30 May 2000, oivvio polite wrote: > A few hundred lines of that can make one somewhat dizzy. > > What I'd want to have instead is a somekind of oo wrapper for sql, > probably something working on top of the python db api. Something that > would let my say: > > oldtable1 = dboo.table.existing(connection,database,tablename1) > oldtable2 = dboo.table.existing(connection,database,tablename2) > newtable = dboo.table.join(newtablename, oldtable1, oldtable2, > some_condition) > > This would take a couple of old tables in the my database join them > whith some condition and insert the result as a new table in the > database. I suppose you could read up on the relational algebra underneath SQL. You could provide your own access to joins, projections, etc. Another strategy is to implement some sort of data access layer that handles all data retrieval. I know some people have had success with the delegation pattern to isolate a persistence layer. > Of course there should be tons of other possible operations. I want to > be able to do pretty much everything I can do with sql, without having > to maintain that horrible sql code. A good understanding of relation algebra would be a good start. Then you'll basically be translating your calls to the SQL equivalent. > Have you seen anything like this for python, or maybe in for some > other language? I don't think that I've seen anything like you're doing, but there are many different ideas about how to provide access to data in a database in a clean, object-oriented manner. I haven't done much reading, but I think that Microsoft has DAO and ADO specifications and Java has some stuff on doing this with enterprise beans (components), You might also want to look into how object-oriented databases provide access to data if they're not using SQL. ---Tom From tbryan@starship.beopen.com Thu Jun 29 03:14:14 2000 From: tbryan@starship.beopen.com (Tom Bryan) Date: Wed, 28 Jun 2000 19:14:14 -0700 (PDT) Subject: [DB-SIG] postgresql-python return type In-Reply-To: Message-ID: On Mon, 19 Jun 2000, Karl Thomas Diedrich wrote: > type(tagetSearchResult) = > I can display the value(query results) of the object with the print > command > print targetSearchResult > > I tried formatting it as a string but I get the object type name instead > of the value > format = '%s' > results = format % (targetSearchResult) > print reults = That's very odd. I'm pretty sure that both print and formatting as %s both call the __str__ method of the class. In that case, the following pieces of code should print the same output for all objects var print var and x = '%s' % var; print x At least now you have a general Python question that you can post to comp.lang.python. Perhaps my claim is incorrect. ----Tom From sa_mak@yahoo.com Fri Jun 30 05:58:50 2000 From: sa_mak@yahoo.com (Mohideen Abdul Kader) Date: Thu, 29 Jun 2000 21:58:50 -0700 (PDT) Subject: [DB-SIG] RE: null value doubt? Message-ID: <20000630045850.13684.qmail@web6202.mail.yahoo.com> hello sir in many table contains no value (i.e., empty records) how can i check if the table contains null value? i using the following code ,from that code i cannot get null value pls exaplain and give sample >>> s.execute("select * from tbllogin where username='mak'") >>> for x in s.fetchall(): ..... print x[0] ..... >>> from the above code return null value , how can i check x[]0 contains null vlaue pls give the example if python contains any isnull or isempty or null keywords if x[0]<>'': print "Empty" else: print x[0] i also checking the above code but 'Empty' vlaue is not dislpay bye Mohideen Abdul Kader M N 34,Veerabathran Street Nungabakkam,Chennai-600 034 India phone: 8210977/6 www.preciousmicrotech.com sa_mak@hotmail.com __________________________________________________ Do You Yahoo!? Get Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/ From hniksic@iskon.hr Fri Jun 30 08:22:51 2000 From: hniksic@iskon.hr (Hrvoje Niksic) Date: 30 Jun 2000 09:22:51 +0200 Subject: [DB-SIG] RE: null value doubt? In-Reply-To: Mohideen Abdul Kader's message of "Thu, 29 Jun 2000 21:58:50 -0700 (PDT)" References: <20000630045850.13684.qmail@web6202.mail.yahoo.com> Message-ID: Mohideen Abdul Kader writes: > from the above code return null value , how can i check x[]0 > contains null vlaue pls give the example if python contains any > isnull or isempty or null keywords In DB-compliant modules, SQL NULL values should map to Python None. You can check for it using `x is None' or `x == None'. For instance: if x[0] is None: print "Empty" else: print x[0]