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: Convert varchar2 -> BLOB

Re: Convert varchar2 -> BLOB

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Wed, 11 May 2005 20:57:19 +0200
Message-ID: <d5tkae$s13$1@news3.zwoll1.ov.home.nl>


Jeremy wrote:

>
> declare
> x utl_http.html_pieces;
> i number;
> l_blob blob;
> l_tempblob blob;
> l_raw_chunk raw(2000);
> begin
> x := utl_http.request_pieces('http://myserver/test.jpg'
> , 10000);
> dbms_lob.createtemporary(l_blob, TRUE);
> for i in 1..x.count
> loop
> l_raw_chunk := utl_raw.cast_to_raw(x(i));
> l_tempblob := l_raw_chunk;
> dbms_lob.writeappend(l_blob,
> dbms_lob.getlength(l_tempblob),
> l_tempblob );
> end loop;
> end;
>
> So thanks for your posts on this - any comments on the above approach?
>

No comments - seems the correct way to do it, again, no experience first hand. Did blobs, did html_pieces, just never had the urge to read pages into the database like this :)

-- 
Regards,
Frank van Bortel
Received on Wed May 11 2005 - 13:57:19 CDT

Original text of this message

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