[DB-SIG] Hoe to.

Wayne infotechsys@pivot.net
Tue, 28 Dec 1999 06:22:43 -0500


Hello,
I'm trying to create a report from information stored in my postgres
database.
The python code looks like this-

def doReport(self, event = 0):
      fileobj = open("testoutput", 'w')
      db = _pg.connect('dbname', 'localhost')
      myrecord = db.query('SELECT * FROM "tablename"')
      fileobj.write(myrecord)

The error I'm getting is telling me that myrecord is a read only buffer.

So, can someonr tell me how I go about writing a record to a file that
is read from the database. The other part of what I'm trying to do is to

print the file that I write. Is there a better way to do this than what
I'm
doing.
Thanks for your time.
Wayne