jcs.readfile

on-site-related topic PL/SQL API jcs.readfile

Summary

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

Copy
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: <scheduler>:<filename>. This option is for backwards compatibility only. If you want to specify a scheduler Partition you cannot use this option anymore.

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.

Copy

         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

Copy
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

Copy
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: <scheduler>:<filename>. This option is for backwards compatibility only. If you want to specify a scheduler Partition you cannot use this option anymore.

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

Copy
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