[Zope] ZOracle - support for LOB [Q]

Doug Hellmann hellmann@GNNcast.net
Thu, 02 Dec 1999 16:08:16 +0000


Bruno,

We use LOBs for all of our content, with Zope as a "smart" cache that
knows how to fetch articles with attributes from the Oracle database. 
I've found the LOB support to be very easy to use within Python code
(since we've written our own Products).  We have to do pre/post
processing of the LOBs when they come out of the database, and this is
complicated enough that it is easier to do in Python instead of DTML. 
If your LOB contains exactly what you want, you could just use the LOB
right from DTML.

The behavior for LOBs is if you fetch rows from the query one at a time,
you get the handle for the LOB so that you call the read() method
directly.  If you fetch rows in an array the assumption seems to be that
you won't have the right context to use the LOB handles later, so you
get the read() value instead of the handle.  In this case, the LOB body
is given to you in a big string.

I would expect you to get strings if you use a Z SQL Method to fetch the
LOB, since the DA code fetches an array of rows at once.  If you write
your own code you have control over how the results of the query are
fetched.

I haven't tried writing into LOBs via DCOracle, so all I can tell you
there is that LOB handles have a write() method.

Doug


Bruno Mattarollo wrote:
> 
> Hello.
> 
>     I am trying to fetch and insert LOB fields into Oracle8i... I have read
> the DCOracle.txt where it states that LOB are supported if fetchdone() is
> used. But are LOB supported using ZOracleDA? Has someone set up some Zope
> site using LOBs in Oracle8i? I need to store articles from our writers that
> are supposed to be superior to 4KB in size so VARCHAR2 is not enough and we
> do not want to store them in separate files because we want to have all
> inside our Oracle Database.
> 
>     Sorry to post so many questions in so many days, but we are getting
> closer to release date and I am trying to finish all our development.
> 
>     TIA
> 
> /B
> 
> Bruno Mattarollo <brunomadv@ciudad.com.ar>
> --- Python Powered <http://www.python.org/psa/>
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
>           No cross posts or HTML encoding!
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )