I have to make a program that will use fseek to read data from pirticular position. i have to read data line by line,and in pirticular line i have to use fseek to read data. But when i am using fseek and absolute_offset is of big size (little bit less then file size),it gives out 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 small absolute_offset value like 4000 range works properly and picks data. Line no 15 where i am using fseek giving 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');
--utl_file.get_line(lv_utl,v_line,50);
--dbms_output.put_line(v_line);
--l_file_length:=length();
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);
--lv_msg_txt := 'empno ename job manager hiredate commission salary department_no';
--UTL_FILE.PUT_LINE(lv_utl,lv_msg_txt);
--UTL_FILE.PUT_LINE(lv_utl,'------------------------------------------------------------------------------------');
--UTL_FILE.PUT_LINE(lv_utl,' ');
--UTL_FILE.FCLOSE(lv_utl);
END;