[Zope-dev] DA Update: BLOBs

Christopher Petrilli petrilli@digicool.com
Fri, 16 Jul 1999 11:14:51 -0400


Gang,

A few people have brought up the support, or lack of support, for BLOBS in
the Zope DA products.  This is something we're acutely aware of, and we have
a customer now who will probably require support for a project we are doing
for them.  This means we're beginning to deal with the issues surrounding
implementing support, which include:

    * Support for statement handles
    * Passing data by reference
    * Extensions to the sqlvar tag

These are all interrelated because of some quoting rule issues.  One of the
details you will probably see introduced at the same time, is a couple of
new fmt options for sqlvar:

    <dtml-sqlvar foo fmt=varchar>
    <dtml-sqlvar foo fmt=varbin>

These are taken from the ODBC standard, and are probably the most agnostic
of options available.  It is important to distinguish between text and
binary BLOBs because of the nature of statement handles.

What are statement handles you ask?  Well, quite simply, they are
pre-digested SQL queries that are held on the server side (somewhat like
anonymous stored procedures, but they don't survive connections).  You can
then call them, substituting data in by reference.  This allows you to pass
in large quantities of data in a clean manner.  It also allows you to go
through the query parser and optimizer once, rather than each time.

What is the implication of this?  Well, it means that there will probably be
some new options on ZSQLMethods that you can set.  One of them will be "hold
as statement handle" which will only be possible on methods which have SQL
components which have *nothing* but <dtml-sqlvar> statements in them.
Anything else, any OR or AND processing and it no longer becomes feasible.
The check-box will be a suggestion to the connection to hold it, but the
connection can choose to ignore this if it isn't supported, or if by some
reason, the number of handles allowed is already exceeded.

Thoughts?

Chris
--
| Christopher Petrilli        Python Powered        Digital Creations, Inc.
| petrilli@digicool.com                             http://www.digicool.com