i'm using UTL_FILE package to read a csv file , then insert values in table, but my issue is how to read values separated by Commas.. , this is my code :
declare
file1 UTL_FILE.FILE_TYPE;
str varchar2(200 CHAR);
begin
file1 := UTL_FILE.FOPEN('DRCT1','test_file.csv','R');
loop
UTL_FILE.GET_LINE(file1,str);
-- here i want to read each value before the Commas then insert them in my table
-- insert statement..
dbms_output.put_line(str);
end loop;
exception
when no_data_found then
UTL_FILE.FCLOSE(file1);
end;
/
this is my csv file :
100,Steven,King
101,Neena,Kochha
102,Lex,De Haan
103,Alexander
104,Bruce,Ernst
please do you have any suggestion to my issue ?
Regards .