create or replace procedure test as f UTL_FILE.file_type; s varchar2(200); a varchar2(200); path varchar2(50); begin path:='c:'; f:=utl_file.fopen('c:','aa.CSV','R'); loop utl_file.get_line(f,s); N:=INSTR(S,',',1,1); a := substr(s,.....) select count(*) into i from aa where aa = a; if i > 0 then update .... set ... else insert into ..... end if; end loop; utl_file.fclose(f); COMMIT; EXCEPTION when NO_DATA_FOUND then utl_file.fclose(f); rollback; end; /
f UTL_FILE.file_type;
s varchar2(200);
a varchar2(200);
path varchar2(50);
begin
path:='c:';
f:=utl_file.fopen('c:','aa.CSV','R');
loop
utl_file.get_line(f,s);
N:=INSTR(S,',',1,1);
a := substr(s,.....)
select count(*) into i from aa where aa = a;
if i > 0 then
update .... set ...
else
insert into .....
end if;
end loop;
utl_file.fclose(f);
COMMIT;
EXCEPTION
when NO_DATA_FOUND then
utl_file.fclose(f);
rollback;
end;
/