From john@nmt.edu Tue Jun 15 23:53:38 1999 From: john@nmt.edu (John W. Shipman) Date: Tue, 15 Jun 1999 16:53:38 -0600 (MDT) Subject: [DB-SIG] Need ctsybase that supports TEXT columns Message-ID: Apparently the version of ctsybase we have here does not support fields of type TEXT. Attempts to fetch a row from a table with such a field raises an exception that looks like this: ================================================================ Traceback (innermost last): File "", line 1, in ? File "swinvdb.py", line 696, in all row = qr.next() File "syhelpers.py", line 988, in next rowTuple = self.cursor.fetchone() SybaseError: ['long columns not yet supported', {'server': '', 'procedure': '', 'msgnumber': 5701, 'type': 'server', 'message': "Changed database context to 'john'.\012", 'line': 65535, 'severity': 10, 'sqlstate': 'ZZZZZ', 'state': 2, 'status': 6}] ================================================================ Here's the top of the source file: ================================================================ /* $Id: ctsybasemodule.c,v 1.9 1997/07/14 04:39:07 pgodman Exp $ $Author: pgodman $ Sybasemodule (ct-lib version), by Peter Godman, 1997 ================================================================ Is there a newer version of this same module that supports long files? If not, is there a free Python-Sybase interface that does? We're a state-supported college computer center and can't afford any expensive proprietary interfaces. Regards, John Shipman (john@nmt.edu), Applications Specialist, NM Tech Computer Center, Speare 128, Socorro, NM 87801, (505) 835-5950, http://www.nmt.edu/~john ``Let's go outside and commiserate with nature.'' --Dave Farber From mal@lemburg.com Wed Jun 16 09:18:31 1999 From: mal@lemburg.com (M.-A. Lemburg) Date: Wed, 16 Jun 1999 10:18:31 +0200 Subject: [DB-SIG] Need ctsybase that supports TEXT columns References: Message-ID: <37675DD7.694007FB@lemburg.com> John W. Shipman wrote: > > Apparently the version of ctsybase we have here does not support > fields of type TEXT. > ... > Is there a newer version of this same module that supports long > files? If not, is there a free Python-Sybase interface that > does? We're a state-supported college computer center and can't > afford any expensive proprietary interfaces. You could try mxODBC which does support long columns and is free for non-commercial and commercial in-house use. For pointers follow the link to my Python pages below. You'll need an ODBC driver for Sybase though (the mxODBC web-page has some linked resources to help you find a suitable one). -- Marc-Andre Lemburg ______________________________________________________________________ Y2000: 198 days left Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/ From tjohnson@matnet.com Thu Jun 17 14:39:57 1999 From: tjohnson@matnet.com (Tim Johnson) Date: Thu, 17 Jun 1999 05:39:57 -0800 Subject: [DB-SIG] Re: DB-SIG digest, Vol 1 #154 - 1 msg References: <199906170500.BAA26448@python.org> Message-ID: <3768FAAD.B0ECD8EF@matnet.com> > You could try mxODBC which does support long columns and is free > for non-commercial and commercial in-house use. For pointers follow > the link to my Python pages below. > When you say the mxODBC is free for commercial use - does the followingapply: Used by a CGI programmer for a ISPN would be free? Distributing as part of a an extended package - would entail a fee? > You'll need an ODBC driver for Sybase though (the mxODBC web-page > has some linked resources to help you find a suitable one). > > -- > Marc-Andre Lemburg > ______________________________________________________________________ > Y2000: 198 days left > Business: http://www.lemburg.com/ > Python Pages: http://www.lemburg.com/python/ > > End of DB-SIG Digest From gerrit.holl@pobox.com Mon Jun 28 10:07:01 1999 From: gerrit.holl@pobox.com (Gerrit Holl) Date: Mon, 28 Jun 1999 11:07:01 +0200 Subject: [DB-SIG] Best format to store web data? Message-ID: <19990628110701.A30332@optiplex.palga.uucp> Hallo, I've got some websites (not too big), and now I'm building a script to generate the news. What is the best data format to store the news in? I've got about 2 news items a day, and every newsitem is about 400 characters text, and a "user", "date", "headline". I store this in s dictonairy and than cPickle it, is that the best way, or is mysql easier and faster? groeten, Gerrit. -- The Dutch Linuxgames homepage: http://linuxgames.nl.linux.org Personal homepage: http://www.nl.linux.org/~gerrit/ Discoverb is a python program (in several languages) which tests the words you learned by asking it. Homepage: http://www.nl.linux.org/~gerrit/discoverb/ From jam@newimage.com Mon Jun 28 13:26:36 1999 From: jam@newimage.com (jam) Date: Mon, 28 Jun 1999 08:26:36 -0400 Subject: [DB-SIG] Best format to store web data? In-Reply-To: <19990628110701.A30332@optiplex.palga.uucp>; from Gerrit Holl on Mon, Jun 28, 1999 at 11:07:01AM +0200 References: <19990628110701.A30332@optiplex.palga.uucp> Message-ID: <19990628082635.A16195@toast.internal> On Mon, Jun 28, 1999 at 11:07:01AM +0200, Gerrit Holl wrote: > > Hallo, > > I've got some websites (not too big), and now I'm building a script to generate > the news. > > What is the best data format to store the news in? I've got about 2 news items > a day, and every newsitem is about 400 characters text, and a "user", "date", > "headline". I store this in s dictonairy and than cPickle it, is that the > best way, or is mysql easier and faster? > > groeten, > Gerrit. > hi. I've already written a couple of different generations of something like this for my website. the answer is 'it depends'. ;) if you are only going to have a couple of news items a day, and you aren't worrying about getting hundreds of hits per minute, then by all means, store the thing in a simple text file and don't even worry about pickle. on the other hand, if you are going to try to expand the system, and you are already familiar with the ins-and-outs of relational databases (or want to learn it), then go with mysql. how about this.. get it up and working with simple text files or pickle, and then start working on the sql based version. this way you can have something together fairly quickly, and then start replacing bits as you go along. you can write tools that will inject your text format files into the database when it becomes available. hope that helps. regards, Jeff -- || visit gfd || psa member #293 || New Image Systems & Services, Inc. From jim@digicool.com Tue Jun 29 12:35:14 1999 From: jim@digicool.com (Jim Fulton) Date: Tue, 29 Jun 1999 07:35:14 -0400 Subject: [DB-SIG] Best format to store web data? References: <19990628110701.A30332@optiplex.palga.uucp> Message-ID: <3778AF72.7017F42@digicool.com> Gerrit Holl wrote: > > Hallo, > > I've got some websites (not too big), and now I'm building a script to generate > the news. > > What is the best data format to store the news in? I've got about 2 news items > a day, and every newsitem is about 400 characters text, and a "user", "date", > "headline". I store this in s dictonairy and than cPickle it, is that the > best way, or is mysql easier and faster? The object database used by Zope would be a good choice. You might also consider Zope itself. See www.zope.org. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. From deirdre@deirdre.net Tue Jun 29 19:24:39 1999 From: deirdre@deirdre.net (Deirdre Saoirse) Date: Tue, 29 Jun 1999 14:24:39 -0400 (EDT) Subject: [DB-SIG] Best format to store web data? In-Reply-To: <3778AF72.7017F42@digicool.com> Message-ID: On Tue, 29 Jun 1999, Jim Fulton wrote: > > I've got some websites (not too big), and now I'm building a script to generate > > the news. > > > > What is the best data format to store the news in? I've got about 2 news items > > a day, and every newsitem is about 400 characters text, and a "user", "date", > > "headline". I store this in s dictonairy and than cPickle it, is that the > > best way, or is mysql easier and faster? > > The object database used by Zope would be a good choice. You might also > consider Zope itself. See www.zope.org. Even better, squishdot (http://members.tripod.com/~squishdot) is exactly what you're looking for -- it generates a /. style "articles" page using python, gadfly and zope. -- _Deirdre * http://www.linuxcabal.org * http://www.deirdre.net "I have a simple rule in life: If I don't understand something, it must be bad." & "If you want more than 4 gig of memory, get a *real* CPU." -- Linus Torvalds, speaking at BALUG (www.balug.org) From vick@opticominc.com Wed Jun 30 14:26:30 1999 From: vick@opticominc.com (Vic Vaishnavi) Date: Wed, 30 Jun 1999 09:26:30 -0400 Subject: [DB-SIG] Bug with the BSDDB Module for NT4.0 Message-ID: <377A1B05.9EC9AA1@opticominc.com> This is a multi-part message in MIME format. --------------09494E4FC21B7397E18C7EBC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello We are using the BSDDB module for Python in our product set and are seeing a really bizarre bug on NT. It seems that as we load data records into the BSDDB dictionary, it crashes at a really unpredictable stage. We have tried to debug it by looking into the KEY length and also the RECORD length but to no avail. We would REALLY appreciate if someone can help us with this issue. For your convenience I am enclosing our test program as well. Note that this bug happens ONLY on NT. We think it has "something" to do with the BSDDB restrictions on how it accesses memory and it seems to violate something causing a Dr.Watson error on NT. If anyone can give us a hand with this, that would be most appreciated. Thanks - Vick --------------09494E4FC21B7397E18C7EBC Content-Type: text/plain; charset=us-ascii; name="dbtest.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dbtest.py" import random import xdbm import time def test (): dbkey = '1' record = '1' count = 0 adb = xdbm.open ('test.db', 'c') longstring1 = 'a' * 1001 while 1: num = random.random() longstring = str(int(num * 1000000)) * 200 keylen = int(random.random() * 16) + 1 reclen = int(random.random() * 1000) + 1 keylen = 6 key = longstring[:keylen] rec = longstring1[:reclen] count = count + 1 print 'count = ', count print 'lengths = ', keylen, reclen, keylen + reclen print 'Key = ', key adb[key] = rec continue try: print'Reading for existing record existence', len(dbkey), len(record) rec = adb[dbkey] print'RECORD ALREADY EXISTS' except: print'###########################################################' print'Entering RECORD in the DATABASE' print'KEY= ',dbkey print'RECORD is = ',repr(record) #self.db[dbkey] = repr(record) adb[dbkey] = record #print'LATEST DATABASE RECORDS = ',len(self.db.keys()) print'###########################################################' adb.close () record = record + '1' if len(record) > 300: record = '1' dbkey = dbkey + '1' aa = raw_input ('hit enter> ') test () --------------09494E4FC21B7397E18C7EBC-- From andy@robanal.demon.co.uk Wed Jun 30 23:12:58 1999 From: andy@robanal.demon.co.uk (Andy Robinson) Date: Wed, 30 Jun 1999 22:12:58 GMT Subject: [DB-SIG] Databases chapter for Python on Windows book Message-ID: <377c9493.1555726@post.demon.co.uk> As some of you know, Mark Hammona dna I are putting the finishing touches to "Python Programming for Win32", due from O'Reilly this autumn. I'm doing the database chapter. I hope you'll forgive me for asking for answers I could probably dig out with a lot of research, but I have a load of other subjects to research too. The book needs to 'punch the right buttons' for corporate developers and IT managers and I am pushing the ideas of data cleaning and transformation scripts in Python. Q1. I know the ODBC API and the Python DB API provide support for precompiled SQL statements. What I don't know is which databases and drivers actually use these to get better performance. Can anyone help out on this? Q2. MySQL has quite a following. Monty granted me a license on Windows for the sake of the book and I'd like to say something about it. Unfortunately I have not yet found a compelling reason to use it for examples. Is there anything neat that MySQL, or the Python interface to it, does that cannot be do with (say) SQL Anywhere, which is just as cheap on Windows? Q3. We like to include 'case studies' of half a page to a page to ram home the point that Python is in use in the real world. Does anyone have any neat stories to tell or projects to boast about? Many thanks, Andy Robinson