[Zope-DB] Database result objects

Henk Laloli Henk.Laloli at niwi.knaw.nl
Mon Feb 2 08:56:50 EST 2004


Hello,

In the Zope Book database result objects like (using result as the name
of a resultset)  result.tuples(), result.asRDB(), result.dictionaries()
are mentioned. I have tried to use these with the ZODBC DA version
3.1.0. b2,  but with MS Windows Database systems like MS Access 2000 and
MS SQL Server 2000 they don't work. The data_dictionary() method and the
names()  method do work. Does anyone know why these methods do not work
in this case?

My code in a python script:

# use an SQL query called SelectPeople with no arguments
result = context.SelectPeople()

# this works
for name in result.names():
    print name

# this does not work
for item in result.tuples():
   print item

I get this error in Zope:

Error Type: AttributeError
Error Value: DatabaseResults instance has no attribute 'tuples'

Henk Laloli




More information about the Zope-DB mailing list