Hi there,
need help and advice as I need to create a PL/SQL package to read the 'bill to' value from text file and the value
will be used to match and update records in hz_cust_site_uses_all using API.
I am trying to code in this way to output the record but seems does not working,
set serveroutput on size 1000000
declare
l_file utl_file.file_type;
l_path VARCHAR2(100):='/var/tmp';
l_filename varchar2(100):='seaoe_cust_bill_to_cpt.txt';
l_text VARCHAR2(32767);
type l_bill_to_tab is table of VARCHAR2(32767);
l_bill_to l_bill_to_tab:=l_bill_to_tab(null);
i NUMBER:=1;
l_location VARCHAR2(100);
l_attribute17 VARCHAR2(2);
begin
-- open file
l_file := utl_file.fopen(l_path, l_filename, 'r',32767);
-- read the file.
begin
loop
utl_file.get_line(l_file, l_text,32767);
l_bill_to(i) :=l_text;
select location, attribute17
into l_location, l_attribute17
from hz_cust_site_uses_all
where location = l_bill_to(i);
dbms_output.put_line(l_location||' '|| l_attribute17);
i := i + 1;
end loop;
exception
when no_data_found then
null;
end;
end;
Thanks.
Regards,
BE