SQL>
SQL> CREATE TABLE lobdemo (
2 key NUMBER,
3 clob_col CLOB,
4 blob_col BLOB);
Table created.
SQL>
SQL>
SQL> DECLARE
2 v_CLOB CLOB;
3 v_Key lobdemo.key%TYPE;
4 CURSOR c_SomeLOBs IS
5 SELECT key, clob_col
6 FROM lobdemo
7 WHERE key BETWEEN 50 and 61;
8 BEGIN
9 OPEN c_SomeLOBs;
10 LOOP
11 FETCH c_SomeLOBs INTO v_Key, v_CLOB;
12 EXIT WHEN c_SomeLOBs%NOTFOUND;
13
14 DBMS_OUTPUT.PUT_LINE(
15 'Length of CLOB at key ' || v_Key || ' is: ' ||
16 DBMS_LOB.GETLENGTH(v_CLOB));
17 END LOOP;
18 CLOSE c_SomeLOBs;
19 END;
20 /
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> drop table lobdemo;
Table dropped.
SQL>