Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Convert varchar2 -> BLOB
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 BortelReceived on Wed May 11 2005 - 13:57:19 CDT