Database Reference
In-Depth Information
C:> false.exe
C:> echo %ERRORLEVEL%
1
C:> true.exe
C:> echo %ERRORLEVEL%
0
Back to the database scheduler. Successful execution of a job is characterized by the value
“SUCCEEDED” in the column STATUS of the view DBA_SCHEDULER_JOB_LOG . Failure is signaled by
the value “FAILED” (not “FAILURE” as stated in the Oracle Database Administrator's Guide 10g
Release 2 on page 2-27). But how does this relate to the exit code of the executable? Except
signaling success or failure, the exit code might also indicate why the external job failed. Could
it be available in DBA_SCHEDULER_JOB_LOG.ADDITIONAL_INFO or in any of the columns STATUS , ERROR# ,
or ADDITIONAL_INFO of the view DBA_SCHEDULER_JOB_RUN_DETAILS ? Some tests reveal that.
￿
Executables that return exit code zero are assigned the job status “SUCCEEDED”. All
other exit codes result in the status “FAILED”.
￿
The exit code itself is not available.
￿The column DBA_SCHEDULER_JOB_RUN_DETAILS.STATUS , which has an undocumented
range of values in the Oracle10g Release 2 Database Reference , has the same range of
values as the column STATUS of the view DBA_SCHEDULER_JOB_LOG (“SUCCEEDED” or
“FAILED”).
Standard Error Output
UNIX shell scripts and windows command-line scripts support the same output redirection
syntax. Both environments provide three default file handles. These are summarized in Table 19-1.
Table 19-1. Input and Output Handles
Handle Designation
Numeric Equivalent
Description
STDIN
0
Keyboard input
STDOUT
1
Output to the terminal window
STDERR
2
Error output to the terminal window
By default, the UNIX command echo prints its arguments to standard output (STDOUT).
To redirect an error message to standard error (STDERR), use a command such as this:
$ echo Command failed. 1>&2
Command failed.
This works in exactly the same way on Windows.
C:> echo Command failed. 1>&2
Command failed.
 
Search WWH ::




Custom Search