LISTING 2: Read LOB in SQL_TEXT

SQL> create table t ( x clob );
Table created.

SQL> insert into t values ( 'hello world' );
1 row created.


SQL> select sql_text from v$open_cursor;

SQL_TEXT
----------------------------------
select sql_text from v$open_cursor


SQL> declare
  2          l_clob clob;
  3  begin
  4          select x into l_clob from t;
  5          dbms_lob.open( l_clob, dbms_lob.lob_readonly );
  6  end;

  7  /

PL/SQL procedure successfully completed.

SQL> select sql_text from v$open_cursor;

SQL_TEXT
----------------------------------

table_4_200_9912_0_0_0
select sql_text from v$open_cursor