Use dbms_lob package to deal with clob data : DBMS_LOB « System Packages « Oracle PL/SQL Tutorial






SQL>
SQL> create global temporary table myTable
  2  ( id    int primary key,
  3    c_lob clob,
  4    b_lob blob
  5  )
  6  /

Table created.

SQL>
SQL> create sequence myTable_seq;

Sequence created.

SQL>
SQL> create or replace function to_clob( p_cname in varchar2,p_tname in varchar2,p_rowid in rowid ) return clob
  2  as
  3      l_clob clob;
  4      l_id   int;
  5  begin
  6      select myTable_seq.nextval into l_id from dual;
  7      execute immediate 'insert into myTable (id,c_lob) select :id, to_lob( ' || p_cname || ' )
  8            from ' || p_tname || ' where rowid = :rid ' using IN l_id, IN p_rowid;
  9
 10      select c_lob into l_clob from myTable where id = l_id ;
 11
 12      return l_clob;
 13  end;
 14  /

Function created.

SQL>
SQL>
SQL> drop table myTable;

Table dropped.

SQL>
SQL> drop sequence myTable_seq;

Sequence dropped.








31.12.DBMS_LOB
31.12.1.DBMS_LOB Package
31.12.2.Print clob data out
31.12.3.Use dbms_lob.getlength to get the length of a clob data
31.12.4.Show Java source file
31.12.5.Use dbms_lob package to deal with clob data
31.12.6.Use dbms_lob.getlength and dbms_lob.substr with blob type column
31.12.7.Use dbms_lob.substr to get part of clob data
31.12.8.DBMS_LOB.READ
31.12.9.Load a file