Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / System Packages
 

Use UTL_FILE package to create a file

SQL> SQL> CREATE OR REPLACE PROCEDURE fcreate (loc_in IN VARCHAR2, file_in IN VARCHAR2)   2  IS   3     fID UTL_FILE.FILE_TYPE;   4  BEGIN   5   6     fID := UTL_FILE.FOPEN (loc_in, file_in, 'W');   7   8     UTL_FILE.FCLOSE (fid);   9  END;  10  / Warning: Procedure created with compilation errors. SQL> SQL> show error Errors for PROCEDURE FCREATE: LINE/COL ERROR -------- ----------------------------------------------------------------- 3/8      PL/SQL: Item ignored 3/8      PLS-00201: identifier 'UTL_FILE' must be declared 6/4      PL/SQL: Statement ignored 6/4      PLS-00320: the declaration of the type of this expression is          incomplete or malformed 8/4      PL/SQL: Statement ignored 8/21     PLS-00320: the declaration of the type of this expression is          incomplete or malformed SQL>