Sub : Problem with LONG RAW please help....

From: Jaison Paul <Jaison.Paul_at_originindia.com>
Date: 19 Aug 2000 14:32:33 +0200
Message-ID: <416EDB2D12C9D311B8AD00508B8BFA4B023F36_at_ORIGINWEB1>


Hi !!

        I am currently working with oracle 8.0 and I have a problem with LONG RAW , The problem is that there is an external utility which updates a table with a text file in its long raw column.Now I have to read this long raw and do some further processing. I could successfully do the same if the size of the uploaded file in the LONG RAW column is <2k. But since PL/SQL does not not support external variables with more than 32k , I cannot read the LONG RAW column in to a local variable and do the further processing.

The table with long raw column has the structure OWS CONTENT table -

OID     		NUMBER;
CONTENT	LONG RAW; 

The content in the CONTENT column has to be read. This is what I am currently doing

    declare


        v stuff LONG RAW;
        v rawchunk  LONG RAW;
        v char     VARCHAR2(4000);

    v totchunks NUMBER ;
    begin
	BEGIN
	  	SELECT A.content
	      INTO   v stuff
	      FROM   ows content A
	      WHERE  A.oid  100 ;
	EXCEPTION
		--If > 32 K exception is raised
		when value error then....
	END ;
  
	LOOP 

--Splitting the whole chunk in to an array of varchar2
v rawchunk : UTL RAW.SUBSTR(v stuff, ctr, 4000);
--Array of varchar2 type
v charchunks(v totchunks) : UTL RAW.CAST TO VARCHAR2(v rawchunk) ; ........ ....... END LOOP ;

I could not use dbms sql.column value long to read the chunk of data since the column is of LONG RAW type. Also I could not use utl raw.substr in the select statement. Is there any other way to solve this problem using PL/SQL alone.

Is there any way by which I could put this LONG RAW values into a BLOB TYPE or LONG type in another table.

Or
can I use any SELECT statement in which I can convert it into a BLOB or LONG .
(i.e SELECT SUBSTR(TO LOB(content)) INTO v blob FROM ows content...some thing similar..)

TIA Jaison.

--
Received on Sat Aug 19 2000 - 14:32:33 CEST

Original text of this message