1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
declare
in_file Text_IO.File_Type;
linebuf1 number;
linebuf2 number;
linebuf3 float(126);
linebuf5 varchar2(60);
al_button NUMBER;
al_button1 NUMBER;
filename VARCHAR2(255);
BEGIN
in_file := Text_IO.Fopen(:charger.fich_nom, 'r');
LOOP
Text_IO.Get_Line(in_file, linebuf1);
Text_IO.Get_Line(in_file, linebuf2);
Text_IO.Get_Line(in_file, linebuf3);
Text_IO.Get_Line(in_file, linebuf5);
if(linebuf1=null) then
exit;
end if;
DELETE FROM compteur WHERE compteur.code_comp=linebuf1;
insert into compteur (code_comp,n_appel,consommation_impl,periode) values(linebuf1,linebuf2,linebuf3,linebuf5);
END LOOP;
EXCEPTION
WHEN no_data_found THEN
Text_IO.Put_Line('Closing the file...');
Text_IO.Fclose(in_file);
al_button := Show_Alert('confirmation');
IF al_button = ALERT_BUTTON1 THEN commit;
end if;
--WHEN others then
-- al_button1:=Show_Alert('alert10');
END; |
Partager