4-4. Creating a Stored Procedure

Problem

There is a database task that you are performing on a regular basis. Rather than executing a script that contains lines of PL/SQL code each time you execute the task, you want to store the code in the database so that you can simply execute the task by name or so that you can schedule it to execute routinely via Oracle Scheduler.

Image Note See Chapter 11 for information on scheduling PL/SQL jobs using Oracle Scheduler.

Solution

Place the code that is used to perform your task within a stored procedure. The following example creates a procedure named INCREASE_WAGE to update the employee table by giving a designated ...

Get Oracle and PL/SQL Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.