Invalid data after converting clob to blob

GOAL: insert adresse or someth. into an msword file out of database
Hi,
I'm working with a 9i database and I'm trying to insert data in a clob. First I convert the blob, which is a stored xml- file in my databse, to a clob. after that i'm replacing the data I want to insert and then reconverting to blob. It goes very well, but when the data I insert contains a 'ö' or 'ä' or 'ß' the blob file i get is invalid and can't be read by msword! I opened the file with notepad and instead of 'ö' etc there is a very strange sign like a square. here is my plsql- code:
loop
test:=substr(v_clob,posi,len);
posi:=posi+32767;
if length(v_clob)-posi<32767 then
len:=length(v_clob)-posi+1;
end if;
--vartest:=utl_raw.cast_to_raw(v_clob);
DBMS_LOB.WRITE(r_blob, length(test),posi-32767, utl_raw.cast_to_raw(test));
exit when posi>length(v_clob);
end loop;
DBMS_LOB.freetemporary(v_clob);
return r_blob;
because of 9i doesn't contain the procedure dbms_lob.converttoblob i user utl_raw.cast_to_raw and split my clob in several parts with a size of 32767 characters
i also tried with utl_raw.convert with several character sets, but don't know which one to take...
nls_lang of database server is set to GERMAN_GERMANY.WE8MSWIN1252
can anyone help me please!
Message was edited by:
user472439

dbms_lob.writeappend expects a real lob locator, which you can only get by selecting from a lob column.
create table blobtab (b blob);
insert into blobtab values (empty_blob());
CREATE OR REPLACE FUNCTION clob_to_blob (clob_in IN CLOB)
RETURN BLOB
AS
v_blob blob;
v_varchar RAW(32767);
v_start BINARY_INTEGER := 1;
v_buffer BINARY_INTEGER := 32767;
BEGIN
select b into v_blob from blobtab;
FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(clob_in) / v_buffer)
LOOP
v_varchar := UTL_RAW.CAST_TO_RAW(DBMS_LOB.SUBSTR(clob_in, v_buffer, v_start)) ;
DBMS_OUTPUT.PUT_LINE(' DATA :' || DBMS_LOB.SUBSTR(clob_in, v_buffer, v_start));
DBMS_OUTPUT.PUT_LINE(' V_VARCHAR :' || v_VARCHAR);
DBMS_OUTPUT.PUT_LINE(' V_VARCHAR LENGTH :' || utl_raw.LENGTH(v_VARCHAR));
DBMS_LOB.WRITEAPPEND(v_blob, utl_raw.LENGTH(v_VARCHAR), v_varchar);
DBMS_OUTPUT.PUT_LINE('after append');
v_start := v_start + v_buffer;
END LOOP;
RETURN v_blob;
END clob_to_blob;
declare
blobvar blob;
begin
blobvar := clob_to_blob(dbms_xmlgen.getXML('select 1 from dual'));
end;
/

Similar Messages

  • Converting CLOB to BLOB

    I am trying to convert clob into blob through following code.
    CREATE OR REPLACE FUNCTION clob_to_blob (clob_in IN CLOB)
    RETURN BLOB
    AS
    v_blob BLOB;
    v_varchar RAW(32767);
    v_start BINARY_INTEGER := 1;
    v_buffer BINARY_INTEGER := 32767;
    BEGIN
    FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(clob_in) / v_buffer)
    LOOP
    v_varchar := UTL_RAW.CAST_TO_RAW(DBMS_LOB.SUBSTR(clob_in, v_buffer, v_start)) ;
    DBMS_OUTPUT.PUT_LINE('DATA :' ||DBMS_LOB.SUBSTR(clob_in, v_buffer, v_start));
    DBMS_OUTPUT.PUT_LINE(' V_VARCHAR :'|| v_VARCHAR);
    DBMS_OUTPUT.PUT_LINE(' V_VARCHAR LENGTH :'|| LENGTH(v_VARCHAR));
    DBMS_LOB.WRITEAPPEND(v_blob, LENGTH(v_VARCHAR), v_varchar);
    DBMS_OUTPUT.PUT_LINE('after append');
    v_start := v_start + v_buffer;
    END LOOP;
    RETURN v_blob;
    END clob_to_blob;
    calling code:
    declare
    var clob;
    begin
    var:='3433534534de';
    testblob(var);
    end;
    It gives me following error:
    declare
    ERROR at line 1:
    ORA-21560: argument 2 is null, invalid, or out of range
    i don't know whats the prob?
    thanx

    dbms_lob.writeappend expects a real lob locator, which you can only get by selecting from a lob column.
    create table blobtab (b blob);
    insert into blobtab values (empty_blob());
    CREATE OR REPLACE FUNCTION clob_to_blob (clob_in IN CLOB)
    RETURN BLOB
    AS
    v_blob blob;
    v_varchar RAW(32767);
    v_start BINARY_INTEGER := 1;
    v_buffer BINARY_INTEGER := 32767;
    BEGIN
    select b into v_blob from blobtab;
    FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(clob_in) / v_buffer)
    LOOP
    v_varchar := UTL_RAW.CAST_TO_RAW(DBMS_LOB.SUBSTR(clob_in, v_buffer, v_start)) ;
    DBMS_OUTPUT.PUT_LINE(' DATA :' || DBMS_LOB.SUBSTR(clob_in, v_buffer, v_start));
    DBMS_OUTPUT.PUT_LINE(' V_VARCHAR :' || v_VARCHAR);
    DBMS_OUTPUT.PUT_LINE(' V_VARCHAR LENGTH :' || utl_raw.LENGTH(v_VARCHAR));
    DBMS_LOB.WRITEAPPEND(v_blob, utl_raw.LENGTH(v_VARCHAR), v_varchar);
    DBMS_OUTPUT.PUT_LINE('after append');
    v_start := v_start + v_buffer;
    END LOOP;
    RETURN v_blob;
    END clob_to_blob;
    declare
    blobvar blob;
    begin
    blobvar := clob_to_blob(dbms_xmlgen.getXML('select 1 from dual'));
    end;
    /

  • How to convert CLOB to BLOB with SQL Developer migration wizard?

    Hi,
    According to our requirement, we need to only migrate data from SQL Server 2008 to Oracle 11. I use the SQL Developer 3.0.04 migration wizard to do it.
    I do migration from SQL Server (database name: SCDS41P2) to Oracle (User name: HCDS41P2).
    My migration steps are as below: (I need to modify the target schema, so I add the steps 2) and step 3) )
    1) Do migration by SQL Developer migration wizard;
    2) Remove the Converted Database Objects node from migration project;
    3) Re-do convert by SQL Developer migration wizard (contains changing the target schema);
    When do step 1), the DBO_SCDS41P2 user is created automatically. CLOBTOBLOB_SQLDEVELOPER procedure is also created in this user.
    I continued to run step 2) and step 3) with online mode. And find the table data which contains BLOB column can be moved into the target table. But from the Logging Page, I can't see the other detailed error info, so that I can't check which tables don't move data successfully.
    Could you please tell me where the detail log file (e.g. contains every table's migration status) is if I use the online mode?
    Additional, If I use offline mode to do step 3), I found the CLOB data can't be converted into BLOB automatically. Because in the load script (that is oracle_ctl.bat), only copy the source data to the CLOB column. After copy, it don't deal with the converting from CLOB to BLOB.
    So could you please tell me how to convert CLOB to BLOB with offline mode?
    Thanks so much.

    Hi,
    For your first question about logging - after the migration there will be an entry in the right hand panel for the migration project. If you open this there are various fields that give information about the status of each part of the migration. Does this give you the information you need ?
    For the second problem about offline moving blob data have a look at the SQL*Developer documentation -
    Oracle® SQL Developer User’s Guide Release 3.0
    in the section -
    2.2.8.1.4 Populating the Destination Database Using the Data Files
    which describes the problem and how to get round it.
    Regards,
    Mike
    Edited by: mkirtley on Aug 12, 2011 10:49 AM

  • Converting CLOB to BLOB at once

    Hello all!
    I have to convert CLOB to BLOB in my application. My CLOB contains XML document built with dbms_xmldom, an I need to put it into column of type BLOB. Knowing several ways to do it, I'm searching for the best one. So I considered the folowing:
    - Size of XML data can be more then 4000 bytes.
    - I can convert it "piecewise", copying through varchar2 and raw buffers by chunks. But this is not efficient for me.
    - I can write CLOB to file, then read it into BLOB. But it is not efficient too.
    - I can not change column type to CLOB since it may contain other BLOB data, not XML.
    Actually, I need a way to "cast" CLOB data as binary data when inserting into table. I believe Oracle must have it, but where?
    I'll be very grateful for help from anyone.
    P.S. Using Oracle 9.2

    You could use UTL_RAW.CAST_TO_RAWhttp://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_raw2.htm#998330
    The XML data can be 32k (the varchar2 limit in PLSQL is 32k, not 4000 bytes)
    If your documents exceeds 32k you need process chunks

  • Convert clob to blob

    Anyone know an easy way to convert clob data to blob data?
    We upgraded a client to 8.1.7.2 and now we can no longer store MS-Word templates to the RDBMS.
    I deduce this is because MS-Word templates are binary files.
    Earlier versions of 8.1.7 and 8.1.6 allowed us to do this. However, this is no longer the case.
    Some of my clob rows are over 6 meg.
    I have written some PL/SQL code to basically retrieve the clob data in cursor, loops through the clob in 32767 blocks,
    performing dbms_lob.substr, converts that data to hex(major pain), & then write the blocks using dbmbs_lob.write.
    I keep getting the proverbial "ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275".
    Does anyone see flaws in my approach and might have an easier solution?
    Thanks!

    Here's my code:
    REATE OR REPLACE
    PROCEDURE p_load_clob_to_blob IS
    * Name:           p_load_clob_to_blob
    * Parameters: None
    * Purpose: This procedure loads the narr_blob column in the narr table_text with clob data from the
    * narr column.
    * Notes: This procedure assumes that narr table has been altered with narr_blob column added.
    * See the SQL below:
    *               alter table narr_text add (narr_blob blob);
    * Once this procedure executes, the table must altered to drop the narr_text clob column,
    * recreate the narr_text as blob, & then repopulate narr_text. See the SQL below:
    *                     alter table narr_text drop column narr;
    *                    alter table narr_text add (narr blob);
    *                    update narr_text set narr = narr_blob;
    *                    commit;
    * Called By: Sys Admin
    * CHANGE LOG
    * Changed By Date Change Description
    * EAO          01/16/02 Created.
    rec_read      INTEGER;
    rec_update      INTEGER;
    write_cnt INTEGER;
    write_amount BINARY_INTEGER;
    write_offset INTEGER;
    write_loop INTEGER;
    total_length      NUMBER;
    total_written      NUMBER;
    buffer VARCHAR2(32767);
    bbuffer RAW(32767);
    temp_narr_id NUMBER;
    max_loop               INTEGER;
    cx                    CLOB;
    bx                    BLOB;
    bx2                    BLOB;
    cur_evt               varchar2(50); -- current event
    v_err_descr          varchar2(256);
    i INTEGER;
    hex                    varchar(32767);
    CURSOR c_load_narr_clob IS
         SELECT narr, narr_id
         FROM narr_text
         where narr_id = 6366;
    BEGIN
    insert_event_log('', 'p_load_clob_to_blob', '', '', '', 'p_load_clob_to_blob started', '');
    rec_read := 0;
    rec_update := 0;
    ---Fill file
    insert_event_log('', 'p_load_clob_to_blob ','c_load_narr_clob ', '', 'S', 'c_narr_clob started', '');
    FOR csr IN c_load_narr_clob LOOP      
         cur_evt := 'Select narr from narr table: ';
         rec_read := rec_read + 1;
         write_loop := 1;
         write_cnt := 0;
         write_offset := 1;           
         total_written := 0;     
         cx := csr.narr;
    bx := empty_blob();          
         total_length := DBMS_LOB.GETLENGTH(cx);
         max_loop := (total_length / 32767) + 1;
         if (total_length <= 32767) THEN
              write_amount := total_length;
         ELSE
              write_amount := 32767;
         END IF;
    dbms_output.put_line('Length=' || to_char(total_length) || ' Max loop=' || to_char(max_loop) || ' Write Amount=' || to_char(write_amount));
         temp_narr_id := csr.narr_id;
         while write_cnt < max_loop
         loop
    --FOR write_loop in 1..max_loop LOOP
              delete temp_blob;
              delete temp_raw;
              commit;
              cur_evt := 'Dbms_lob.substr: ';
              dbms_output.put_line(cur_evt);
    buffer := DBMS_LOB.SUBSTR(cx, write_amount, write_offset);
              dbms_output.put_line('Write Amount='|| to_char(write_amount) || ' Write Offset=' || to_char(write_offset) );
    cur_evt := 'Hex to Raw Assigment: ';
              dbms_output.put_line(cur_evt);
              bbuffer := null;
              for i in 1..write_amount loop
                   hex := numtohex(ascii(substrb(buffer,i,1)));
                   bbuffer := bbuffer || hextoraw(hex);
              end loop;
    cur_evt := 'Insert temp_raw: ';
              dbms_output.put_line(cur_evt);
              insert into temp_raw(rx)
                   values (bbuffer);
              commit;
    cur_evt := 'Insert temp_blob: ';
              dbms_output.put_line(cur_evt);
              execute immediate 'insert into temp_blob(bx)
                   select TO_LOB(rx) from temp_raw';
              commit;
              cur_evt := 'Select bx2: ';
              dbms_output.put_line(cur_evt);
              bx2 := empty_blob();
              select bx into bx2 from temp_blob;
              cur_evt := 'Dbms_lob.append: ';
              dbms_output.put_line(cur_evt);
              dbms_lob.append(bx, bx2);
         dbms_output.put_line('Write Amount='|| to_char(write_amount) || ' Write Offset=' || to_char(write_offset) );
              write_offset := write_offset + write_amount;
              total_written := total_written + write_amount;
              write_cnt := write_cnt + 1;
              if (write_cnt = max_loop) then
              write_amount := total_length - total_written;
              end if;
    END LOOP;
    dbms_output.put_line('Total_written = ' || to_char(total_written) );
         cur_evt := 'Upd narr_blob in narr table: ';
         update narr_text
         set narr_blob = bx
         where narr_id = temp_narr_id;
         rec_update := rec_update + 1;
         commit;
    END LOOP;
    insert_event_log('', 'p_load_clob_to_blob ','c_load_narr_clob ', '', 'C', 'c_narr_clob completed', '');
    dbms_output.put_line('Records read=' || to_char(rec_read) || ' Records updated=' || to_char(rec_update) );
    insert_event_log('', 'p_load_clob_to_blob', '', '', '', 'p_load_clob_to_blob ended', '');
    EXCEPTION
         WHEN OTHERS THEN
         Rollback;
         v_err_descr := 'FATAL ERROR OCCURRED -'||cur_evt||sqlerrm;
         dbms_output.put_line (v_err_descr);
    END;
    FUNCTION numtohex(v_hex number) return varchar2
    is
    hex varchar2(4);
    num1 number;
    num2 number;
    begin
    num1 := trunc(v_hex/16);
    num2 := v_hex-(num1*16);
    if ( num1 >= 0 and num1 <= 9 ) then
    hex := hex||to_char(num1);
    end if;
    if num1 = 10 then hex := hex||'A'; end if;
    if num1 = 11 then hex := hex||'B'; end if;
    if num1 = 12 then hex := hex||'C'; end if;
    if num1 = 13 then hex := hex||'D'; end if;
    if num1 = 14 then hex := hex||'E'; end if;
    if num1 = 15 then hex := hex||'F'; end if;
    if ( num2 >= 0 and num2 <= 9 ) then
    hex := hex||to_char(num2);
    end if;
    if num2 = 10 then hex := hex||'A'; end if;
    if num2 = 11 then hex := hex||'B'; end if;
    if num2 = 12 then hex := hex||'C'; end if;
    if num2 = 13 then hex := hex||'D'; end if;
    if num2 = 14 then hex := hex||'E'; end if;
    if num2 = 15 then hex := hex||'F'; end if;
    return hex;
    end;

  • Converting varchar2 to BLOB or converting CLOB to BLOB

    Hi i am using a table where i have to convert a field currently existing as a varchar2 or CLOB to a BLOB field.
    while doing this i also have to preserve the data currently existing in the table.
    Please help.
    Thanks

    CLOB to a BLOB CREATE OR REPLACE FUNCTION clob_to_blob (clob_in IN CLOB) RETURN BLOB AS
    v_blob BLOB;
    v_varchar RAW(32001);
    v_varchar1 RAW(32001);
    v_start INTEGER := 1;
    v_buffer INTEGER := 32001;
    BEGIN
    DBMS_LOB.CREATETEMPORARY(v_blob, TRUE);
    FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(clob_in) / v_buffer) LOOP
    DBMS_LOB.READ(clob_in,v_buffer,v_start,v_varchar);
    DBMS_LOB.WRITEAPPEND(v_blob, utl_raw.length(v_varchar), v_varchar);
    v_start := v_start + v_buffer;
    END LOOP;
    RETURN v_blob;
    END clob_to_blob;
    /

  • How to convert clob to blob

    hi
    tell me some thong how we can convert clob to blob

    You can use my procedure
    create or replace procedure CLOB2BLOB (p_clob in out nocopy clob, p_blob in out nocopy blob) is
    -- transforming CLOB &#226; BLOB
    l_off number default 1;
    l_amt number default 4096;
    l_offWrite number default 1;
    l_amtWrite number;
    l_str varchar2(4096 char);
    begin
    begin
    loop
    dbms_lob.read ( p_clob, l_amt, l_off, l_str );
    l_amtWrite := utl_raw.length ( utl_raw.cast_to_raw( l_str) );
    dbms_lob.write( p_blob, l_amtWrite, l_offWrite,
    utl_raw.cast_to_raw( l_str ) );
    l_offWrite := l_offWrite + l_amtWrite;
    l_off := l_off + l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    Best regards, Victor

  • LOB : how convert CLOB into BLOB

    This code doesn't work : ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error.
    declare
    vCLOB CLOB := empty_clob();
    vBLOB BLOB := empty_blob();
    begin
    dbms_lob.createTemporary(vCLOB,TRUE);
    dbms_lob.open(vCLOB, DBMS_LOB.LOB_READWRITE);
    -- Put data into CLOB
    l_length := dbms_lob.getlength(vCLOB);
    dbms_lob.read(vCLOB,l_length,1,buffer);
    dbms_lob.createTemporary(vBLOB,TRUE);
    dbms_lob.open(vBLOB, DBMS_LOB.LOB_READWRITE);
    dbms_lob.write(vBLOB,l_length,1,buffer);
    dbms_lob.close(vBLOB);
    dbms_lob.freeTemporary(vBLOB);
    dbms_lob.close(vCLOB);
    dbms_lob.freeTemporary(vCLOB);
    Thanks.

    You can use my procedure
    create or replace procedure CLOB2BLOB (p_clob in out nocopy clob, p_blob in out nocopy blob) is
    -- transforming CLOB &#226; BLOB
    l_off number default 1;
    l_amt number default 4096;
    l_offWrite number default 1;
    l_amtWrite number;
    l_str varchar2(4096 char);
    begin
    begin
    loop
    dbms_lob.read ( p_clob, l_amt, l_off, l_str );
    l_amtWrite := utl_raw.length ( utl_raw.cast_to_raw( l_str) );
    dbms_lob.write( p_blob, l_amtWrite, l_offWrite,
    utl_raw.cast_to_raw( l_str ) );
    l_offWrite := l_offWrite + l_amtWrite;
    l_off := l_off + l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    Best regards, Victor

  • How to convert clobs to blobs?

    What is the easiest way to go if I want to copy the content of a CLOB to a BLOB(Other than reading the contents of the CLOB out into a buffer and then apply UTL_RAW.CAST_TO_RAW)? How about from blobs to clobs?
    null

    Hi,
    create table myblob(x blob);
    create table myblob1(x clob);
    create or replace procedure blob_to_clob as
    b_lob blob;
    buffer VARCHAR2(32000);
    g_length number;
    begin
    select x into b_lob from myblob;
    g_length := dbms_lob.getlength(b_lob);
    dbms_lob.read(b_lob,g_length,1,buffer);
    insert into myblob1 values(buffer);
    commit;
    end;
    null

  • The ADO NET Source was unable to process the data. ORA-64203: Destination buffer too small to hold CLOB data after character set conversion.

     We developed a SSIS Package to pull the data From Oracle source to Sql Server 2012. Here we used ADO.Net source to pull the records from Source but getting the below error after pulling some 40K records.
      [ADO NET Source [2]] Error: The ADO NET Source was unable to process the data. ORA-64203: Destination buffer too small to hold CLOB data after character set conversion.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. 
     The PrimeOutput method on ADO NET Source returned error code 0xC02090F5. 
     The component returned a failure code when the pipeline engine called PrimeOutput(). 
    The meaning of the failure code is defined by the component, 
    but the error is fatal and the pipeline stopped executing. 
     There may be error messages posted before this with more 
    information about the failure.
    Anything that we can do to fix this?

    Hi,
      Tried both....
      * Having schema type as Nvarchar(max). - Getting the same error.
      * Instead of ADO.Net Source used OLEDB Source with driver as " Oracle Provide for OLE DB" Getting error as below.
           [OLE DB Source [478]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
           [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on OLE DB Source returned error code 0xC0202009.  The component returned a failure
    code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the
    failure.
    Additional Info:
       * Here the Source task is getting failed not the conversion or destination task.
    Thanks,
    Loganathan A.

  • Converting data from a clob to RTF in Oracle Reports

    Hello
    I have created a table in my database and one of the columns is a CLOB , data in the CLOB i've copied from a word document .
    I've created a report that has to retrieve the value from the CLOB in RTF output, the problem is that the output is in binary format .
    If someone can help me i relly appreciate.
    Another thing , i tried saving a doc file into a html file , opening the html file with a notepad , and the content of the notepad putting into a CLOB , after putting in the text into the first tab 'text' i've checked the html tab and it appears to be ok in plsql dev,in report I used on the field properties that contains html tags = yes . But the output was not the same as in the CLOB tab html , it had other formatting and looked totally different , i'm almost sure that the problem is from tags , but modifying them takes too much time and I have too many reports that i must make in word and i cannot work on modifying the tags.
    PS: I use Oracle Reports 6i
    Anyone knows an alternative method for putting data from a doc document into a clob and making a query in reports that retrieves the value of the clob , and the output has to be rtf or pdf ?
    Thank you in advance
    Edited by: user7274785 on 05.10.2009 00:42

    Duplicate question.
    unload data to a csv in unix oracle 11g

  • How to use clob or blob data type in OWB

    how to use clob or blob data type in OWB?
    if OWB not surport these data type,how can i extract the large data type from data source

    The same question was asked just two days ago No Data Found: ORA-22992
    Nikolai Rochnik

  • How to convert a CLOB to BLOB

    Hi,
    Can any one tell me how to convert a CLOB into BLOB? In Oracle 10g there is a function which is converttoblob(). But in Oracle 9i there is no function as such. If i am using Hextoraw() function still then its giving some pointer error. please let me know the solution.

    FUNCTION c2b( c IN CLOB ) RETURN BLOB
    -- typecasts CLOB to BLOB (binary conversion)
    IS
    pos PLS_INTEGER := 1;
    buffer RAW( 32767 );
    res BLOB;
    lob_len PLS_INTEGER := DBMS_LOB.getLength( c );
    BEGIN
    DBMS_LOB.createTemporary( res, TRUE );
    DBMS_LOB.OPEN( res, DBMS_LOB.LOB_ReadWrite );
    LOOP
    buffer := UTL_RAW.cast_to_raw( DBMS_LOB.SUBSTR( c, 16000, pos ) );
    IF UTL_RAW.LENGTH( buffer ) > 0 THEN
    DBMS_LOB.writeAppend( res, UTL_RAW.LENGTH( buffer ), buffer );
    END IF;
    pos := pos + 16000;
    EXIT WHEN pos > lob_len;
    END LOOP;
    RETURN res; -- res is OPEN here
    END c2b;

  • Converting CHAR or CLOB to BLOB in Oracle9i

    Hi!
    I want to convert CHAR or CLOB to BLOB.
    I am working with Oracle9i Database.
    Oracle9i Supplied PL/SQL Package Release 2 (9.2) does'nt support DBMS_LOB.CONVERTTOBLOB procedure.
    How I can convert CHAR or CLOB to BLOB in Oracle9i?
    Valery

    Hi Valery,
    For conversion to blob, just try the utl_raw package.
    I use utl_raw.cast_to_raw quite often.
    Or have a look at:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:437819871174
    Good luck,
    Jan-Marcel

  • How to convert CLOB data (now it is in html format) to Normal text format

    Hi,
    Can anybody let me know the solution for how to convert CLOB data into normal Text.In my case the table column having CLOB datatype and the data is in html format.when i run the report the column is displaying html tags .Now i need to convert that html tags into normal text.
    Pl. let me know if any one know the solution.
    Regards,
    Thulasi.K

    LONG has been depricated since 8i so I don't believe there is a general solution to go backwards short of reloading the data.
    Justin

Maybe you are looking for

  • Install failed and now computer won't reboot!

    Hi there, I have tried to install the snow leopard 10.6.3 update CD on my Mac and I was told it failed and that I needed to restart - however, I hit restart and I get the start-up chime and apple logo on white with spinning gear underneath, but that'

  • When I cut/paste articles from the web, images aren't pasted

    Hi. I cut and paste lots of articles from websites into documents. When I do this on my iPad Air, none of the images in the articles gets pasted into my document; only the text is copied. I DO NOT have this problem on my Chrome Book, my HP laptop, or

  • PROBLEM WITH THE "SNOOZE" vis a vis ALARM

    can anybody tell me, how to stop ALARM FROM SNOOZING OR HOW TO STOP THE ALARM BUTTON. I tried sliding the STOP AND SNOOZE button,....doesnt work...?? even HELP provided on the Nokia X6 16GB doesnt give any information on this ?? thanx astral

  • How connect T61 with docking to HDTV

    Hi, I have a T61 Thinkpad laptop and trying to connect to my Panasonic Plasma HDTV. I have my T61 connected to my dock which has a dvi output. I used a DVI to HDMI connector cable to connect to a female to female HDMI connector, which is connect to t

  • Problemas con la previsualización de videos en Adobe Premiere Pro CS6

    Hola, tengo Adobe Premiere CS6 instalado en Windows 8. Parece que funciona bien hasta que importo un vídeo en formato AVI (ya que el formato MTS no lo reproduce con audio). En ese momento, el programa va lento, se bloquea, no responde...es imposible