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: Jeremy <newspostings_at_hazelweb.co.uk>
Date: Tue, 11 Nov 2003 08:01:37 -0000
Message-ID: <MPG.1a1aa7b83e92bb3a98993b@news.individual.net>


In article <JdTrb.9942$hB5.7297_at_nwrdny02.gnilink.net>, avdbi_at_hotmail.com says...
>
> "Jeremy" <newspostings_at_hazelweb.co.uk> wrote in message
> news:MPG.1a1a0aef6261430e98993a_at_news.individual.net...
> > 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?
> >
>
> Can't you just convert RTF to text and store it as a CLOB?
> That might make things easier for you.
> There are converters available out there which do this....
>

OK - let me alter the scenario. We have a table with a CLOB column which contains an RTF document. Using pl/sql, what is the easiest way to read the CLOB and replace all occurrences of 'x' with 'y'?

On 8.1.7 I don't see DBMS_LOB procedures or functions which appear to do a simple REPLACE - can you help?

-- 

jeremy
['75 RD250A] | ['02 Fazer 600 in blue] 
Received on Tue Nov 11 2003 - 02:01:37 CST

Original text of this message

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