PL/SQL API jcs.open
Summary
- function open(filename in varchar2, scheduler_name in varchar2, flags in number, scheduler_partition in varchar2, src_charset in varchar2) return number (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 open(job_id in number, filetype in number, flags in number, src_charset in varchar2) return number
Get a filehandle for an OS file, with jcs.open, to use in the read, search or close calls
If you are finished, call jcs.close; this will clear the cache, preserve memory and close connections.
Exceptions
Privileges
A job can read its own output and logfile; otherwise the READFILE system privilege is required. If the caller has SELECT privilege on the job or queue or script, then the file can be read.
Specification
function open(filename in varchar2,
scheduler_name in varchar2 default null,
flags in number default 0,
scheduler_partition in varchar2 default null,
src_charset in varchar2 default null)
return number
Parameters
- filename - the file to read
- scheduler_name - the name of the scheduler that determines the host where the file can be found
- flags - the read mode
- scheduler_partition - the partition of the scheduler that determines the host where the file can be found
- src_charset - the name of the characterset of the source
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.
The following bits can be set in flags (by simple addition): use_mask_contr_chars, use_mask_8bit_chars, set_mask_contr_chars, set_mask_8bit_chars and mode_binary. The definitions are given below:
use_mask_contr_chars can be specified as a value in jcs.open flags parameter to control the masking of control characters. If the bit is NOT set, the parameter readfile_mask_ctrl determines the behaviour. If the bit IS set, the behaviour is defined by the bit set_mask_contr_chars (see below)
set_mask_contr_chars can be specified as a value in jcs.open flags parameter to control the masking of control characters. If the bit is set AND the bit use_mask_contr_chars is set, control characters are masked.
use_mask_8bit_chars can be specified as a value in jcs.open flags parameter to control the masking of 8 bit characters. If the bit is NOT set, the parameter readfile_mask_8bit determines the behaviour. If the bit IS set, the behaviour is defined by the bit set_mask_8bit_chars (see below)
set_mask_8bit_chars can be specified as a value in jcs.open flags parameter to control the masking of control characters. If the bit is set AND the bit use_mask_8bit_chars is set, 8 bit characters are masked.
mode_binary can be specified as a value in jcs.open flags parameter to establish a binary readmode.
This interface can open arbitrary files, with an unknown encoding. When src_charset is not set no conversion will take place. When src_charset is set, it is assumed that the source had and encoding equivalent to the indicated characterset. src_charset must be a fullblown charactersetname, e.g. AMERICAN_AMERICA.WE8ISO8859P1
- returns number -
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 open(job_id in number,
filetype in number default const.job_output_file,
flags in number default 0,
src_charset in varchar2 default null)
return number
Get a filehandle for a job-related file to use in the read, search or close calls
Parameters
- job_id - the ID of the job
- filetype - 0 = output file, 1 = log file
- flags - the read mode (cf above)
- src_charset - the name of the characterset of the source
This interface can open arbitrary files, with an unknown encoding. When src_charset is not set no conversion will take place. When src_charset is set, it is assumed that the source had and encoding equivalent to the indicated characterset. src_charset must be a fullblown charactersetname, e.g. AMERICAN_AMERICA.WE8ISO8859P1
- returns number -
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