PL/SQL API jcs.readfile
Summary
- function readfile(filename in varchar2, linenr in number) return varchar2 (Note 1) when p_filename is not in a job directory, that you need to add the folder of the file to the server_root for the Platform Agent. Note 2) the process server p_scheduler needs to have a PlatformAgent Service and the file needs to reside on the RemoteHost of this Process Server)
- function readfile(job_id in number, linenr in number, filetype in number) return varchar2 (In Cronacle 8 it is not possible to specify a characterset at format level. Therefore the characterset cannot automatically derived from the job-format. Note that when the read line is silently truncated after 32767 characters. )
- function readfile(filename in varchar2, text in varchar2, beginline in number, flags in number) return varchar2 (Note 1) that when the read line is silently truncated after 32767 characters. Note 2) when p_filename is not in a job directory, that you need to add the folder of the file to the server_root for the Platform Agent. Note 3) the process server p_scheduler needs to have a PlatformAgent Service and the file needs to reside on the RemoteHost of this Process Server)
- function readfile(job_id in number, text in varchar2, beginline in number, flags in number, filetype in number) return varchar2 ( Note that when the read line is silently truncated after 32767 characters. )
Returns a line of text from the indicated file.
note
These procedures are obsolete. Use jcs.read
The line to be returned can either be an explicit line number, or it can be a result of a search for a pattern.
Lines longer than 2000 characters are silently truncated if jcs.set_text_mode is not called.
If you are finished, call jcs.readfile with a null filename; this will clear the cache and preserve memory.
Exceptions
Privileges
A job can read its own output and logfile; otherwise the READFILE system privilege is required. If a job ID is specified, and the caller has SELECT privilege on the job or queue or script, then the file can be read. If a filename is specified, the OS security will be used to determine access to the file.
Specification
function readfile(filename in varchar2,
linenr in number)
return varchar2
Read from the given file.
note
This interface is obsolete, use jcs.read instead.
You can specify a filename on any system using the following syntax in the filename parameter: '
If you specify just a filename, the file must be an output file or log file of an existing (committed) job, and the system will search all jobs for the correct job_id and check that you have access to the file. This can be quite slow, so we recommend specifying a job_id instead.
Using jcs.readfile in a script with a parameter P_STRING.
begin
jcs_out.put_line(jcs.readfile(123, '%' || P_STRING ||'%', 1, 0, 1));
exception
when no_data_found then
jcs_out.put_line('Nothing found!');
end;
Parameters
- filename - the file to read
- linenr - line to read
- returns varchar2 -
Transaction keyword
The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.
network_agent
Specification
function readfile(job_id in number,
linenr in number,
filetype in number default 0)
return varchar2
Read from the output or log file from the given job.
note
This interface is obsolete, use read instead.
Parameters
- job_id - the ID of the job
- linenr - line to read
- filetype - 0 = output file, 1 = log file
- returns varchar2 -
Transaction keyword
The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.
network_agent
Specification
function readfile(filename in varchar2,
text in varchar2,
beginline in number default 1,
flags in number default 0)
return varchar2
Search for a pattern and return the full line where it occurs from the given file.
note
This interface is obsolete, use read instead.
You can specify a filename on any system using the following syntax in the filename parameter: '
If you specify just a filename, the file must be an output file or log file of an existing (committed) job, and the system will search all jobs for the correct job_id and check that you have access to the file. This can be quite slow, so we recommend specifying a job_id instead.
Parameters
- filename - the file to read
- text - search pattern, a % wildcard must be specified at the end of the pattern.
- beginline - line to start the search for the pattern on
- flags - modification flags on how to perform the search; sum of zero or more of the following values:
- jcs.search_ignorecase: ignore upper/lowercase differences
- jcs.search_entireword: search string must be separated by spaces or tabs
- jcs.search_reversedir: search up, not down
- jcs.search_nowildcard: switches off the LIKE scanning, removing special meaning from % (procent) and _ (underscore)
- returns varchar2 -
Transaction keyword
The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.
network_agent
Specification
function readfile(job_id in number,
text in varchar2,
beginline in number default 1,
flags in number default 0,
filetype in number default 0)
return varchar2
Search for a pattern and return the full line where it occurs from the file in the given job.
note
This interface is obsolete, use read instead.
Parameters
- job_id - the ID of the job
- text - search pattern, a % wildcard must be specified at the end of the pattern.
- beginline - line to start the search for the pattern on
- flags - modification flags on how to perform the search; sum of zero or more of the following values:
- jcs.search_ignorecase: ignore upper/lowercase differences
- jcs.search_entireword: search string must be separated by spaces or tabs
- jcs.search_reversedir: search up, not down
- jcs.search_nowildcard: switches off the LIKE scanning, removing special meaning from % (procent) and _ (underscore)
- filetype - 0 = output file, 1 = log file
- returns varchar2 -
Transaction keyword
The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.
network_agent
See Also
plsqlTopic
onsiteTopic