UTL_FILE

The UTL_FILE package enables PL/SQL programs the ability to read and write operating system text files.

In the current release, this package is restricted to access of a pre-defined temporary directory only. Refer to the Oracle TimesTen In-Memory Database Release Notes.

Note:

Users do not have execute permission on UTL_FILE by default. To use UTL_FILE in TimesTen, an ADMIN user or instance administrator must explicitly grant EXECUTE permission on it, such as in the following example:

GRANT EXECUTE ON SYS.UTL_FILE TO scott;

Table 7-10 describes the UTL_FILE subprograms.

Table 7-10 UTL_FILE Subprograms

Subprogram Description

FCLOSE procedure

Closes a file.

FCLOSE_ALL procedure

Closes all file handles.

FCOPY procedure

Copies a contiguous portion of a file to a newly created file.

FFLUSH procedure

Physically writes all pending output to a file.

FGETATTR procedure

Reads and returns the attributes of a file.

FGETPOS procedure

Returns the current relative offset position (in bytes) within a file.

FOPEN function

Opens a file for input or output.

FOPEN_NCHAR function

Opens a file in Unicode for input or output.

FREMOVE procedure

With sufficient privilege, deletes a file.

FRENAME procedure

Renames an existing file to a new name (similar to the UNIX mv command).

FSEEK procedure

Adjusts the file pointer forward or backward within the file by the number of bytes specified.

GET_LINE procedure

Reads text from an open file.

GET_LINE_NCHAR procedure

Reads text in Unicode from an open file.

GET_RAW function

Reads a RAW string value from a file and adjusts the file pointer ahead by the number of bytes read.

IS_OPEN function

Determines if a file handle refers to an open file.

NEW_LINE procedure

Writes one or more operating system-specific line terminators to a file.

PUT procedure

Writes a string to a file.

PUT_LINE procedure

Writes a line to a file and appends an operating system-specific line terminator.

PUT_LINE_NCHAR procedure

Writes a Unicode line to a file.

PUT_NCHAR procedure

Writes a Unicode string to a file.

PUT_RAW function

Accepts as input a RAW data value and writes the value to the output buffer.

PUTF procedure

This is similar to the PUT procedure, but with formatting.

PUTF_NCHAR procedure

This is similar to the PUT_NCHAR procedure, but with formatting. Writes a Unicode string to a file with formatting.