[Zope] Calling sql method from FS product

Andrew Veitch andrew@logicalprogression.net
Wed, 11 Dec 2002 16:51:45 +0000


> need your help: how to call sql method from the filesystem product?

Call it by:
result=self.queryTable()

Then you've got len(result) or result.tuples() or result.dictionaries() or
result[row][column] or even result.asRDB() to look at.

> should i create this sql method through the web before, or is it
> possible to call sql directly from product code?

To create the method:

from ZSQLMethods.SQL import SQL

self._setObject('queryTable', SQL('queryTable', 'title', 'database
connection', 'parameters if any', 'sql query'))

Queries on relational databases are best going to zope-db@zope.org

A

-- 
Logical Progression Ltd, 3 Randolph Crescent, Edinburgh, EH3 7TH, UK
Tel: +44 (0)131 466 9585 Web: http://www.logicalprogression.net/