SQL>
SQL> CREATE OR REPLACE PROCEDURE show_file (loc IN VARCHAR2,file IN VARCHAR2)
2 IS
3 fid UTL_FILE.FILE_TYPE := UTL_FILE.FOPEN (loc, file, 'R');
4 line VARCHAR2(2000);
5 BEGIN
6 DBMS_OUTPUT.PUT_LINE (file);
7 LOOP
8 UTL_FILE.GET_LINE (fid, line);
9 DBMS_OUTPUT.PUT_LINE (line);
10 END LOOP;
11 EXCEPTION
12 WHEN OTHERS THEN UTL_FILE.FCLOSE (fid);
13 END;
14 /
SQL>
|