I need to make a program that will use fseek to read data from the pirticular position. I have to read data line by line, and in a pirticular line I have to use fseek to read data. But when I use fseek and absolute_offset is large (a little smaller than the file size), it throws this error
ORA-29284: file read error
ORA-06512: at "SYS.UTL_FILE", line 219
ORA-06512: at "SYS.UTL_FILE", line 1145
ORA-06512: at line 15"
but with a small absolute_offset value, such as 4000, it works correctly and selects the data. Line number 15 where I use fseek giving an error.
DECLARE
lv_utl UTL_FILE.FILE_TYPE;
v_buff VARCHAR2(2000);
l_exists boolean;
l_block VARCHAR2(2000);
l_file_length number;
v_line varchar2(5000);
BEGIN
UTL_FILE.fgetattr('/d04/data/edi/inbound','POO0001.dat',l_exists,l_file_length,l_block);
lv_utl := UTL_FILE.FOPEN('/d04/data/edi/inbound','POO0001.dat','R');
dbms_output.put_line(l_file_length);
utl_file.fseek(lv_utl,1261061);
utl_file.get_line(lv_utl,v_buff,100);
dbms_output.put_line(v_buff);
END;
source
share