TO_LOB demo : TO_LOB « Large Objects « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE myClobTable (id NUMBER,clob_data CLOB);

Table created.

SQL>
SQL> CREATE TABLE myLongTable (id NUMBER,long_data LONG);

Table created.

SQL>
SQL> INSERT INTO myLongTable VALUES (100,RPAD('A',200000,'A'));

1 row created.

SQL>
SQL>
SQL> INSERT INTO myClobTable
  2    SELECT id,TO_LOB(long_data)
  3    FROM myLongTable;

1 row created.

SQL>
SQL>
SQL> drop table myLongTable;

Table dropped.

SQL>
SQL>
SQL> drop table myClobTable;

Table dropped.

SQL>
SQL>
SQL>








34.9.TO_LOB
34.9.1.Call to_lob to convert long to clob
34.9.2.TO_LOB demo