Oracle® OLAP DML Reference 11g Release 2 (11.2) E17122-08 |
|
|
PDF · Mobi · ePub |
The FILEQUERY function returns information about a file. The attribute argument you specify in your FILEQUERY function call determines the type of information that is returned.
The data type of the return value depends on the attribute you specify. See Table 7-10, "File Attributes Returned by FILEQUERY" for more information.
A fileunit number or a file name.
A fileunit number is a number that Oracle OLAP assigned to a file you opened through a previous call to the FILEOPEN function or through the OUTFILE command. You can use the return value of the FILEOPEN function or the value of the OUTFILEUNIT option.
A file name is a text expression specifying the name of the file you want to move or rename. 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 a CDA statement 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.Some attributes require that you specify a fileunit number; others require the file name. In many cases, you can specify either. See Table 7-10, "File Attributes Returned by FILEQUERY" for more information.
Specifies the type of information you want to retrieve about the file. The data type of FILEQUERY's return value depends on the attribute you specify. The attribute you specify must be appropriate for the file; otherwise, an error occurs. Table 7-10, "File Attributes Returned by FILEQUERY" lists the valid keywords for attrib-arg and, for each keyword, provides a description and indicates whether you specify a file-unit-number of a file-name for the file-id argument.
Table 7-10 File Attributes Returned by FILEQUERY
Keyword | Return Values | Return Data Type | file-id Parameter |
---|---|---|---|
APPEND |
|
|
Fileunit number |
BMARGIN |
The number of blank lines that form the bottom margin. |
|
Fileunit number |
CHANGED |
|
|
Fileunit number or file name |
EOF |
|
|
Fileunit number |
EXISTS |
|
|
Fileunit number or file name |
FILENAME |
The file name associated with the fileunit. |
|
Fileunit number |
LINENUM |
The current line number. Resets after each page break when PAGING is on; keeps incrementing when PAGING is off. When file is currently open in READ mode, returns the current record number. |
|
Fileunit number |
LINESLEFT |
The number of lines left on the page. |
|
Fileunit number |
LSIZE |
For a file that is open for writing, the line length for the standard Oracle OLAP page heading. (See the STDHDR program.) For a fileunit that is open for reading, specifies the record length for binary input files. |
|
Fileunit number |
NLS_CHARSET |
The character set being used for this fileunit. See the FILEOPEN function for more information. |
|
Fileunit number |
NUMBYTES |
The size of the file in bytes. |
|
Fileunit number or file name |
ORIGIN |
The type of computer on which the file was created. The ORIGIN attribute, which is relevant only for files that are open for reading, is set when you issue a FILESET statement. |
|
Fileunit number |
PAGENUM |
The current page number. See "Paging Attributes". |
|
Fileunit number |
PAGEPRG |
The Oracle OLAP program or statement that produces headings when output is paged. See "Paging Attributes". |
|
Fileunit number |
PAGESIZE |
The number of lines on each page. See "Paging Attributes". |
|
Fileunit number |
PAGING |
|
|
Fileunit number |
PAUSEATPAGEEND |
|
|
Fileunit number |
R[EAD] |
|
|
Fileunit number |
RO |
|
|
Fileunit number or file name |
TABEXPAND |
|
|
Fileunit number or file name |
TMARGIN |
The number of blank lines that form the top margin. |
|
Fileunit number |
UNIT |
The file unit for the specified file name. |
|
File name |
W[RITE] |
|
|
Fileunit number |
When you want tab characters in the source file to be expanded when read by FILEGET or FILEREAD, you can specify the TABEXPAND attribute with the FILESET command. When TABEXPAND is zero, tab characters are not expanded. A value greater than 0 indicates the distance, in bytes, between tab stops. The default value of TABEXPAND is 8.
The paging attributes apply only to files that currently, unless otherwise noted, have PAGING set to YES
and are open in WRITE mode -- such as files opened with FILEOPEN(...WRITE) or FILEOPEN(...APPEND). You can set any of the paging attributes with the FILESET command.
(UNIX only) When querying for UNIX file names, wildcard characters (that is, * ?
) are allowed when searching with the EXISTS attribute argument.
Example 7-93 Setting Paging Options for a File Opened for Writing
The following statements show how the paging options are set for a file opened for writing.
DEFINE fil.unit INTEGER fil.unit = FILEOPEN('REPORT' WRITE)
The statement
SHOW FILEQUERY(fil.unit PAGING)
produces the following output.
YES
The statement
SHOW FILEQUERY(fil.unit PAGESIZE)
produces the following output.
66
The statement
SHOW FILEQUERY(fil.unit TMARGIN)
produces the following output.
5
The following statement closes the file.
FILECLOSE fil.unit