DECLARE
  v_CLOBlocator CLOB;
  v_BLOBlocator BLOB;
BEGIN
  -- Initializes the clob_col to the specified string, and returns the
  -- locator into v_LOBlocator.
  INSERT INTO lobdemo (key, clob_col)
    VALUES (20, 'abcdefghijklmnopqrstuvwxyz')
    RETURNING clob_col INTO v_CLOBlocator;  -- Modifies blob_col for the same row.
  UPDATE lobdemo
    SET blob_col = HEXTORAW('00FF00FF00FF')
    WHERE key = 20;  -- Retrieves the locator for the newly updated value, not the value
  -- itself.
  SELECT blob_col
    INTO v_BLOBlocator
    FROM lobdemo
    WHERE key = 20;
END;
/

解决方案 »

  1.   

    REM lobcopy.sql
    REM Version 1.0, last updated 8/8/97
    REM This file demonstrates the DBMS_LOB.COPY routine, as described in
    REM Chapter 21 of _Oracle8 PL/SQL Programming_ by Scott Urman.SET SERVEROUTPUT on
    DECLARE
      v_Lob1 CLOB;
      v_Lob2 CLOB;
    BEGIN
      -- Retrieve source lob locator.
      SELECT clob_col
        INTO v_Lob1
        FROM lobdemo
        WHERE key = 1;  -- Retrieve destination lob locator.
      SELECT clob_col
        INTO v_Lob2
        FROM lobdemo
        WHERE key = 2;  -- Copy all 26 characters from v_Lob1 onto the end of v_Lob2, starting
      -- at offset 50.  Since v_Lob2 isn't 50 characters long, spaces will
      -- be inserted.
      DBMS_LOB.COPY(v_Lob2, v_Lob1, 26, 50, 1);  -- And output the result.
      LOBPrint(v_Lob2);
    END;
    /
      

  2.   

    DBMS_LOB.WRITE (
       lob_loc  IN OUT  NOCOPY CLOB   CHARACTER SET ANY_CS,
       amount   IN             BINARY_INTEGER,
       offset   IN             INTEGER,
       buffer   IN             VARCHAR2 CHARACTER SET lob_loc%CHARSET); 用此函数,把内容写为空
      

  3.   

    我用过,直接update blob ----------就可以了啊。