Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Working with BLOBS

Re: Working with BLOBS

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 10 Nov 2003 13:42:51 -0800
Message-ID: <1068500592.500159@yasure>


Jeremy wrote:

>In article <1068497208.914442_at_yasure>, damorgan_at_x.washington.edu says...
>
>
>>Jeremy wrote:
>>
>>
>>
>>>Hi - PL/SQL Oracle 8i (8.1.7)
>>>
>>>We have a document stored in a BLOB. We know this is an RTF (rich text
>>>format) and it contains 'placeholders' (e.g. [last_name] which we then
>>>wish to substitute with the person's name).
>>>
>>>So we read the BLOB into a PL/SQL block - what is the most
>>>efficient/easiest way of performing our string replacements?
>>>
>>>If it were in a varchar2, we could simply say
>>>
>>> l_doc := replace(l_doc,'[last_name]',l_last_name);
>>>
>>>Is there an equivalent with BLOBS? Or do I need to read it in chunks
>>>into a varchar2, process it and then reassemble it as a new BLOB?
>>>
>>>Thanks for any pointeres here....
>>>
>>>
>>>
>>>
>>>
>>BLOB or CLOB? Because I don't think you'll find doing string
>>replacements in BLOBs
>>a particularly enjoyable activity.
>>
>>Either way ... the functionality is contained in the DBMS_LOB built-in
>>package.
>>Documentation is available at http://tahiti.oracle.com.
>>
>>
>>
>
>Thanks - it is character data in this case - RTF is all printable
>characters. It is stored in a generic documents table which may contain
>binary data as well, hence the BLOB data type chosen for storage.
>
>So... as it is very much CLOB....does this make it easier?
>
>
>

The problem here is BLOB vs CLOB. If you don't need the formatting, or could easily
recreate it, dump the text as CLOB and editing is easy. The problem with BLOB is that
they are not, by their nature, editable in the database. You could do it but it would be
more than a royal pain in the .... unless someone sells a third-party tool for doing
precisely what you want.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Nov 10 2003 - 15:42:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US