Hello,
When I use UTL_FILE_GET_LINE I always get the error:
(EXC04) - Message cannot be found.
Version 15.0.0.2 on Ubuntu.
Trace shows, that the file is open:
execute function informix.utl_file_is_open[procid=613] ( arg[0] = 0 )
expression:
(select (<procedure> utl_file_is_open, logfile)
from systables
where (= tabid, 1))
evaluates to t ;
let x = t
expression:(not-null txt)
evaluates to t
execute (<procedure> utl_file_get_line, logfile, txt);
execute procedure informix.utl_file_get_line[procid=615] ( arg[0] = 0 , arg[1] = )
exception : looking for handler
SQL error = -937 ISAM error = 0 error string = = "utl_file_get_line (EXC04 - Message cannot be found.)"
exception : no appropriate handler
Writing to file and append works fine.
Here a repro:
database stores;
create or replace procedure read_file()
returning varchar(255);
define logfile utl_file_file_type;
define txt lvarchar(32672);
define x boolean;
set debug file to "kalu.out";
trace on;
let txt='';
select UTL_FILE_FOPEN("/tmp","IFX_Text_Output.txt","r")
into logfile
from systables where tabid = 1;
select UTL_FILE_IS_OPEN(logfile)
into x
from systables where tabid = 1;
while txt is not null
call UTL_FILE_GET_LINE(logfile,txt);
return txt with resume;
end while
call UTL_FILE_FCLOSE(logfile);
end procedure;
Mit freundlichen Grüßen / Kind regards
Gerd Kaluzinski
Delivery Consultant Data
IBM Technology Expert Labs
Phone: +49 175 228 1983 IBM Deutschland GmbH
Email: gerd.kaluzinski@de.ibm.com Mies-van-der-Rohe-Straße 6, 80807 München
IBM Deutschland GmbH
Vorsitzender des Aufsichtsrats: Ivo Körner
Geschäftsführung: Wolfgang Wendt (Vorsitzender), Dr. Andreas Buchelt, Dr. Frank Kohls, Christine Rupp
Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB 14562