data to copy from clob to blob column
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: data to copy from clob to blob column

  1. #1
    Join Date
    Jun 2003
    Location
    India
    Posts
    118

    data to copy from clob to blob column

    I am tring to copy data from clob col. to blob col. the code for that is written as below.

    declare
    a number;
    v_blob blob := empty_blob();
    amount binary_integer;
    offset integer;
    buffer varchar2(32000);
    buffer2 raw(32000);
    cursor c1 is select address ,add2, rowid from xyz for update;
    begin
    for i in c1
    loop
    select add2 into v_blob from xyz where rowid = i.rowid;
    a := dbms_lob.getlength(i.address);
    DBMS_LOB.READ ( i.address, a, 1, buffer);
    buffer2 := utl_raw.cast_to_raw(buffer);
    DBMS_LOB.WRITE(v_blob, utl_raw.length(buffer2), 1, buffer2);
    update xyz set add2 = v_blob where rowid=i.rowid;
    end loop;
    end;

    But getting folloing errors
    *
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified:
    ORA-22275
    ORA-06512: at "SYS.DBMS_LOB", line 767
    ORA-06512: at line 16

    What is error cause.

    Thanks
    vishal sood
    OCP 8

  2. #2
    Join Date
    Jun 2003
    Location
    India
    Posts
    118
    the above metioned has been done as I haven't intilized the blob col . I intilized it as update table_name set col_name = empty_blob();

    My mistake.

    But the same code giving same error in Linux where in Windows it is running fine.

    Just to clear At windows we hv Oracle 9.2.0.4 and on Linux we have Oracle 8.1.7.0

    Thanks
    vishal sood
    OCP 8

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width