PL/SQL User's Guide and Reference

Contents Index Home Previous Next

Support for File I/O

The new package UTL_FILE, which is supplied with the Oracle Server, allows your PL/SQL programs to read and write operating system (OS) text files. It provides a restricted version of standard OS stream file I/O, including open, put, get, and close operations.

When you want to read or write a text file, you call the function fopen, which returns a file handle for use in subsequent procedure calls. For example, the procedure put_line writes a text string and line terminator to an open file. The procedure get_line reads a line of text from an open file into an output buffer.

PL/SQL file I/O is available on both the client and server sides. However, on the server side, file access is restricted to those directories explicitly listed in the accessible directories list, which is part of the Oracle initialization file.

For more information, see Oracle7 Server Application Developer's Guide.


Contents Index Home Previous Next