exec readfile('c:\!', 'imp.txt');
WI,00000012 WO,00000123
exec readfile('c:\test\', 'imp.txt');
create directory TEMP_DIR as 'u/oracle/tmp/; grant read on directory TEMP_DIR to bayser;
declare cn varchar2(25); v_file UTL_FILE.FILE_TYPE; BEGIN v_file := UTL_FILE.FOPEN('TEMP_DIR','111.txt','r'); LOOP begin UTL_FILE.GET_LINE(v_file,cn); dbms_output.put_line(''||cn||''); exception WHEN NO_DATA_FOUND THEN EXIT; end; end loop; UTL_FILE.FCLOSE(v_file); END;
create directory TEMP_DIR as 'u/oracle/tmp/; grant read on directory TEMP_DIR to bayser;
declare cn varchar2(25); v_file UTL_FILE.FILE_TYPE; BEGIN v_file := UTL_FILE.FOPEN('TEMP_DIR','111.txt','r'); LOOP begin UTL_FILE.GET_LINE(v_file,cn); dbms_output.put_line(''||cn||''); exception WHEN NO_DATA_FOUND THEN EXIT; end; end loop; UTL_FILE.FCLOSE(v_file); END;