Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

Reading Oracle BLOBS from Zope

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


kenglund at sbc

Sep 7, 2007, 12:08 PM

Post #1 of 3 (2220 views)
Permalink
Reading Oracle BLOBS from Zope

I want to read an Oracle BLOB and display it. I have seen several
examples on the internet, but none of them seem to work.

I am on the following platform:

Zope Version (Zope 2.6.1 (source release, python 2.1, linux2), python
2.1.3, linux2) Python Version 2.1.3 (#1, Sep 19 2002, 21:42:04) [GCC
2.96 20000731 (Red Hat Linux 7.3 2.96-110)] System Platform linux2

I am trying to read a BLOB from an Oracle database. I have noticed
that when I test the ZSQL, I get the following error:



The SQL:

select wgtphot_photo as photo from kenglund.wgtphot where wgtphot_pidm
= 252853

This seems to be returning the image ok. I had to set the max results
to one to get it to work.

The Python:

result = []
lob = ['image']
for row in context.sqllogo:
lob = row['photo']
# result.append({'image': lob.read()})
# above was remmed
container.REQUEST.RESPONSE.setHeader('content-type', 'image/jpeg') return lob

The Web page:

<td><img src="logo;" alt="foto"></td>

Can you give me some ideas as to what I am doing wrong, or if it is
even possible to do what I am trying? I know we are on an old version
of Zope and Python. I inherited this system from someone no longer
working here, and upgrading is on my to-do list.

Thanks so very much!

Ken Englund
Sweet Briar College
Sweet Briar, Virginia
United States


_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


lists at zopyx

Sep 7, 2007, 11:15 PM

Post #2 of 3 (2072 views)
Permalink
Re: Reading Oracle BLOBS from Zope [In reply to]

--On 7. September 2007 15:08:48 -0400 "Kenneth A. Englund"
<kenglund [at] sbc> wrote:

> I want to read an Oracle BLOB and display it. I have seen several
> examples on the internet, but none of them seem to work.
>
> I am on the following platform:
>
> Zope Version (Zope 2.6.1 (source release, python 2.1, linux2), python
> 2.1.3, linux2) Python Version 2.1.3 (#1, Sep 19 2002, 21:42:04) [GCC
> 2.96 20000731 (Red Hat Linux 7.3 2.96-110)] System Platform linux2
>

Zope 2.6.1 is *old*. You might look at the various SQLAlchemy wrappers
available for Python which should support Oracle BLOBs.

-aj


charlie at egenix

Sep 8, 2007, 2:03 AM

Post #3 of 3 (2079 views)
Permalink
Re: Reading Oracle BLOBS from Zope [In reply to]

Am 07.09.2007, 21:08 Uhr, schrieb Kenneth A. Englund <kenglund [at] sbc>:

> I am trying to read a BLOB from an Oracle database. I have noticed that
> when I test the ZSQL, I get the following error:

The error seems to be missing from your post. The code itself looks
reasonable.

Charlie

--
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.