[Zope] Zope/DB2/SQLRelay and BLOBs

Christoph Schmitz cschm@gmx.de
Tue, 5 Nov 2002 18:40:39 +0100


Hi all,

we're (quite happily) running Zope and DB2 (via SQLRelay) on several=20
Linux boxes.

Currently, we are trying to put large chunks of data into DB2 BLOBs=20
and serve them via Zope. Someone suggested just using a ZSQLMethod=20
for selecting the respective field and <dtml-var> to display it,=20
making sure the Content-Type is correct.=20

I tried to reproduce that solution, using an ZSQLMethod and DTML as=20
follows:

SQL Method testselect:
=09select data from blobtest where id =3D 42

DTML:
=09<dtml-in testselect>
=09=09<dtml-var data>
=09</dtml-in>

All I see is a textual representation of my data in hexadecimal.=20

A common recommendation I saw (relating to Oracle, MySQL or=20
PostgreSQL) was to treat this issue in Python scripts.

Has anyone accomplished any way of serving BLOBs from Zope in a simple=20
fashion as shown above (or in any way at all) using DB2 and SQLRelay?=20
I'd really like to avoid hacking database specific Python scripts...

Thanks in advance,

Christoph