Re: Casting LONG RAW to BLOB in PL/SQL??

From: Bill Coulam <bcoulam_at_usa.net>
Date: Tue, 25 Jan 2000 22:07:35 -0700
Message-ID: <388E8117.8F40014_at_usa.net>


I have implemented exactly what you describe. But if you don't have 4.0.8.1 yet (with 2 patches on top of that), get it soon. 4.0.8 was a living hell and pretty much broke my production system for 2 months while I waited on development to get me patches to stuff that used to work. ANYWAY, with 4.0.7.1 and now 4.0.8.1+ I was able to move uploads to my own attachments table (putting the LONG RAW content into a CLOB or BLOB depending on whether the upload was binary or text (which I determine from file extension -- there's probably a more elegant way). However, it would not have been possible without Oracle 8.1.5. In it they introduced the TO_LOB function which converts a LONG or LONG RAW to the LOB types. Unfortunately, the PL/SQL engine doesn't support TO_LOB, so I had to embed any calls to it in native dynamic SQL strings. Hope that helps get you off on the right foot. If you still get stuck, I might consider releasing portions of our code. If you don't have 8i, then your best bet is going to be using a 3GL language like Java or Pro*C to read the LONG RAW out and then put it back into the DB through parameters that support the LOB Oracle types. Good luck, because I've never used that approach.

  • best wishes, bill c.

Bastiaan Schaap wrote:

> Hi everyone,
>
> Does anyone perhaps have a procedure for transferring data in a long raw
> column to a blob column in an Oracle8 database? I'm developing an
> application on Oracle Application Server 4.0.8, where I want to use the new
> file uploading capabilities... However the webserver puts all the files in
> the OWS_CONTENT table, in a long raw field. I want to copy that data to my
> own tables, if possible in a blob field. This because with a blob field I
> can use my own procedures to stream data back to the clients. Has anyone had
> this problem before? Please help....
>
> TIA,
>
> Bastiaan Schaap
Received on Wed Jan 26 2000 - 06:07:35 CET

Original text of this message