Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: UPDATEBLOB statement ?

    Hi,

    Is there anything like 'UPDATEBLOB' statement in Oracle. If so where it is used and in which version of Oracle it is available. Please give some example queries for the same.

    Thanks,
    Sam

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    dbms_lob package ...

    Ex:
    ....
    ....
    ....
    -- Set to empty_clob to start with ---
    STMT2 := 'update '||v_table_name||'
    set '||c_column_updated||' = empty_clob()
    WHERE '||c_key_columns;

    cur_n2 := dbms_sql.open_cursor;
    dbms_sql.parse(cur_n2,stmt2,dummy);
    c2 := dbms_sql.execute(cur_n2);
    dbms_sql.close_cursor(cur_n2);

    -- Get row for update and rewrite clob value ---

    STMT2 := 'SELECT '||c_column_updated||'
    FROM '||v_table_name||'
    WHERE '||c_key_columns||' for update';

    EXECUTE IMMEDIATE STMT2 INTO LOBLOC;

    if amount > 0
    then
    dbms_lob.write(lobloc,amount,1,sys.utl_raw.cast_to _varchar2(v_bits));
    end if;
    END IF;

    HTH
    Gregg

Posting Permissions

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