Within my Oracle PL/SQL procedure, I am storing a stream of values within one CLOB field where the values are separated by a carriage return/line feed. The values within my CLOB field can vary in size.
An example stream of data that I might have might look like this:
AAAA
BBBB
CCCC
DDDD
EEEE
FFFF
As mentioned above, each line in this example is separated by a carriage return/line feed but is stored all within one CLOB field, i.e. ELEMENT which is of type CLOB.
What I would like is to be able to read this ELEMENT field, take each value, prior to each carriage return/line feed and insert it as one row into a database table, i.e:
MY_TABLE (ID NUMBER, MY_ELEMENT VARCHAR2(256))
So using the data above, I would like the following end result:
MY_TABLE:
1, AAAA
2, BBBB
3, CCCC
4, DDDD
5, EEEE
6, FFFF
The problem I am having is that I am unsure how to extract the values within my ELEMENT CLOB field and turn them into individual rows as described above.