Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
View PDF |
The FILEOPEN function opens a file, assigns it a fileunit number (an arbitrary integer), and returns that number. You use the fileunit number, rather than a file name, in any further references to the file. When Oracle OLAP cannot open the file, an error occurs.
Return Value
INTEGER
Syntax
FILEOPEN(file-name {READ|WRITE|APPEND} [BINARY]) [NLS_CHARSET charset-exp]
Arguments
A text expression specifying the name of the file you want to open. Unless the file is in the current directory, you must include the name of the directory object in the name of the file.
Note: Directory objects are defined in the database, and they control access to directories and file in those directories. You can use the CDA command to identify and specify a current directory object. Contact your Oracle DBA for access rights to a directory object where your database user name can read and write files. |
Opens the file for reading. (Abbreviated R)
Opens the file for writing. File access begins at the top of the file. Therefore, opening an existing file in WRITE mode erases its contents completely even before anything is written to the file. (Abbreviated W)
Opens the file for writing. File access begins at the end of the file, and data is added to the existing contents.
Opens a binary-format file (a file with packed or binary data). When you specify BINARY, Oracle OLAP considers every character in the file to be data. Rather than using newline characters to tell when records end, it assumes records of a fixed length, which you can set with FILESET(...LSIZE). The default record length is 80.
Specifies the character set that Oracle OLAP will use when reading data from the file specified by file-name. When this argument is omitted, then Oracle OLAP handles the data in the file as having the database character set, which is recorded in the NLS_LANG option.
Notes
You can open as many files at the same time as your operating system allows.
The mode of access, READ, WRITE, or APPEND, must be appropriate to the file.
The OUTFILE command also opens a file and assigns an arbitrary integer as the fileunit number.
When specifying a file name, be sure to match upper, lower, and mixed case exactly with the name of the file you want to open -- unless your operating system makes no case distinctions.
Examples