Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

insert CLOB data into table

OraLearnerOct 6 2022

Hi,
We have a requirement to insert CLOB data into table.
CLOB data is stored like this:
col1,col2,col3,col4,col5 LineFeed
val1,val2,val3,val4,val5 LineFeed
val1,val2,val3,val4,val5

I am able to split it into string based on the LineFeed but how can i insert that string in the table (as a row).
I have tried below logic to convert comma separated string into rows but i don't need rows. I need them as column values.
with c_rec as
(
select
to_char(trim(
regexp_substr(l_string, '[^,]+', 1, levels.column_value)
)) as col_val
from dual,
table(cast(multiset(
select level from dual
connect by level <= length (regexp_replace(l_string, '[^,]+')) + 1
) as sys.OdciNumberList)) levels
)
select col_val
from c_rec

Your help will be really appreciated.

Thanks

This post has been answered by OraLearner on Oct 7 2022
Jump to Answer
Comments
Post Details
Added on Oct 6 2022
3 comments
744 views