Re: 9.2 - extracting BLOB data - not handle
Posted in 1999
Our front end is the webblade. In an app page, we get the BLOB handle back when
we select blobcol from foo. The only way to get the data is to do something like
select blobcol::lvarchar::clob from foo which presents other problems since you
are representing binary data in a character type.
The other anomoly is that in dbaccess and sql editor select blobcol from foo
returns neither the data nor the handle. In these clients you simply get blobcol
<SBlob Data> or <blob; length = 12345>
BTW: This question was instantiated by a desire to have an application page
return an image ( Content type : image/gif not Content-type: text/html ) rather
than an html page with an image tag in it.
Eric
"Art S. Kagel" wrote:
> Eric,
> What are you using for a front-end? In ESQL/C it is simply a
> matter of preparing the statement and describing it. Then you modify the
> locator structure for the column to specify the loc_loctype field be
> either LOCMEMORY or LOCUSER. With the former the BLOB data is placed in
> memory (either a block you allocate or you can let the library allocate
> it), in the LOCUSER case you provide OPEN, WRITE, and CLOSE functions
> which are called by the ESQL library at FETCH time and you can place the
> BLOB data anywhere you want using the WRITE function which is called for
> each 2K block of the BLOB. LOCUSER is the fastest way to fetch BLOBs,
> LOCMEMORY the easiest. See sample code in the samples directory, the
> ESQL/C manual, and in several of the utilities I have posted in utils2_ak
> in the IIUG Software Repository (notably ul.ec, dbcopy.ec and myschema.ec).
>
> There are also DBD/DBI facilities to do something similar to LOCMEMORY if
> that is your front-end, see Jonathan's sample code.
>
> Art S. Kagel
>
> Eric Weaver wrote:
> >
> > Server : 9.2
> >
> > Question:
> >
> > select blobcol from foo; returns the BLOB handle not the data. I've tried a> > bunch of different things (SPL, Java UDRs, Casting) and everything seems to
> > return the LO handle rather the the binary data.
> >
> > Does anyone know how to extract the actual data (not the LO handle) from a
> > smart blob column using SQL?
> >
> > Thanks,
> > Eric Weaver, Intelihealth