O'Reilly logo

Oracle and PL/SQL Recipes: A Problem-Solution Approach by Matt Arena, Josh Juneau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11-6. Scheduling a Job Chain

Problem

You have several PL/SQL procedures that must run in a fixed sequence—some steps sequentially, others in parallel. If one step fails, processing should stop.

Solution

Use the DBMS_SCHEDULER _CHAIN commands to create and define the order of execution of the chained procedures. Figure 11-1 depicts a simple example of a chain of procedures where the successful completion of step 1 kicks off parallel executions of two additional steps. When the two parallel steps compete successfully, the final step runs.

Image

Figure 11-1. Flowchart representation of a job chain.

The following code shows how you can use the CREATE_CHAIN ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required