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!

Loaded csv file (pure text) then parse and transform into table column and records

Gor_MahiaAug 3 2023

All,

I need help with the below scenario using Oracle 11g

My source table contains csv files in the below format:

PROJ_ATTACHED_FILES_T

(

FILE_NAME VARCHAR2(200 BYTE) NOT NULL,

MIME_TYPE VARCHAR2(200 BYTE) NOT NULL,

FILE_CONTENT BLOB NOT NULL,

FILE_SIZE NUMBER NOT NULL,

CREATED_BY VARCHAR2(20 BYTE),

CREATED_DATE DATE

);

example:

file1.csv is pure text like below:

col1, col2, col3

datacol11, datacol12, datacol13

datacol21, datacol22, datacol23

and in my myTarget table once parsed and inserted my results are normal records as varchar2 dataset:

select * from myTarget;

col1 | col2 | col3 | sourceName

datacol11 | datacol12 | datacol13 | file1.csv

datacol21 | datacol22 | datacol23 | file1.csv

any idea on how to parse and split into columns and rows as shown above I'll really appreciate.

Using Oracle 11g

thank you.

This post has been answered by Barbara Boehmer on Aug 5 2023
Jump to Answer
Comments
Post Details
Added on Aug 3 2023
15 comments
2,738 views