plsql - Oracle 11 pl/sql read values from a CSV file to a temp table -


i need update values in existing table values csv file. matching possible original csv files. existing loading procedures, values need read not parsed. have 2 csv files different content in column x. before loading second 1 db, want update values in db according data in file 2, column x, matching still possible. how can load csv file 2 utl file read temp table?

to read file in plsql u should next steps, 1. should create objet directory. ea

create directory dir_tmp ‘c:\temp’; grant read, write on directory dir_tmp user; 

2.to read.

create or replace procedure reading v_file utl_file.file_type; v_line varchar2(1024); begin v_file := utl_file.fopen (‘dir_tmp’, ‘test_utl_file.txt’,‘r’); loop utl_file.get_line (v_file, v_line); dbms_output.put_line (v_line); end loop; utl_file.fclose(v_file);  exception when no_data_found dbms_output.put_line (‘end file’); end; / 

3.- there several exception useful ea.

utl_file.invalid_operation utl_file.access_denied 

erod


Comments