3 Replies Latest reply on Dec 3, 2009 7:30 PM by Rnr-Oracle

    bash script exit code in dbms_scheduler

    597392
      Hi
      One little question. How to catch exit code from executable script in dbms_scheduler and use it n=in chain condition. Is it possible??
      Regards
      Jarek
        • 1. Re: bash script exit code in dbms_scheduler
          Rnr-Oracle
          Hi,

          In 10.2 it is difficult to do this. In 11.1 and higher the error number returned by the script is recorded as the error code of the chain step.

          -Ravi
          • 2. Re: bash script exit code in dbms_scheduler
            597392
            Hi
            thanks for your replay.

            Saying difficult you mean impossible ??.

            Regard
            Jarek
            • 3. Re: bash script exit code in dbms_scheduler
              Rnr-Oracle
              Hi,

              It is difficult because there is no direct supported way to do this. There may be a way to do it though.

              The bash script step will log a row to all_scheduler_job_run_details. In additional_info the error code is recorded but it is converted into the system error message corresponding to the message. If you have a list of these system error messages it is easy to convert this back to an error code.

              So you could write a pl/sql function that takes a job name and step name, retrieves the last job run row, parses out the system error message, converts it to an error code and returns it.

              Then you could use this function in your chain rules (using the full where clause syntax).

              Hope this helps,
              Ravi.