SQL>
SQL> CREATE TABLE MyTable (
2 num_col NUMBER,
3 char_col VARCHAR2(60)
4 );
Table created.
SQL>
SQL>
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 v_Data DBMS_OUTPUT.CHARARR;
3 v_NumLines NUMBER;
4 BEGIN
5 DBMS_OUTPUT.ENABLE(1000000);
6
7 DBMS_OUTPUT.PUT_LINE('Line One');
8 DBMS_OUTPUT.PUT_LINE('Line Two');
9 DBMS_OUTPUT.PUT_LINE('Line Three');
10
11 v_NumLines := 3;
12
13 DBMS_OUTPUT.GET_LINES(v_Data, v_NumLines);
14
15 FOR v_Counter IN 1..v_NumLines LOOP
16 INSERT INTO MyTable (char_col)
17 VALUES (v_Data(v_Counter));
18 END LOOP;
19 END;
20 /
PL/SQL procedure successfully completed.
SQL>
SQL> select * from MyTable;
NUM_COL CHAR_COL
---------- ------------------------------------------------------------
Line One
Line Two
Line Three
SQL>
SQL> drop table MyTable;
Table dropped.
SQL>
SQL>