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 LONG RAW to BLOB

Re: convert LONG RAW to BLOB

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 02 Nov 1999 09:28:47 -0500
Message-ID: <nfQeOH2mowAdo0jR17oDrKhFq=uq@4ax.com>


A copy of this was sent to nicky <nicky_at_unilinknet.com> (if that email address didn't require changing) On Tue, 02 Nov 1999 13:07:57 GMT, you wrote:

>Hi
>I use Oracle 8i
>How to convert LONG RAW to BLOB in PL/SQL code like following
>
>create or raplace function xxx(...) return long raw ...;
>/
>create procedure yyy(...)
>is
> l_raw long raw;
> l_blob blob;
>begin
>...
> l_blob := xxx(...); -- ???
>...
> insert into zzz values( ..., l_blob, ...);
>end;
>
>10x in advance
>Nicky
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

Use the TO_LOB() function available in 8i.

insert into zzz
select a, b, c, to_lob( long_raw_column ) from aaa /

If you try to use to_lob in a plsql function/procedure, you'll need to use dynamic sql as the plsql engine cannot do the to_lob function, for example, you'll code:

begin

   execute immediate

      'insert ino zzz select a, b, c, to_lob(long_raw_column) from aaa'; end;

that 'hides' the to_lob call from plsql.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Nov 02 1999 - 08:28:47 CST

Original text of this message

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