We provided a very detailed discussion about Oracle stored procedures and their generation procedures in Section 6.3.7.5.7 in Chapter 6. Refer to that section to get more details about building a stored procedure with Oracle SQL Developer.

Perform the following steps to build the Oracle stored procedure InsertNewCourse with

Oracle SQL Developer:

1) Open the Oracle SQL Developer and click on the system database, XE, under Recent to connect to the Oracle database by entering the system password, oracle _ 18c. Then expand the Other Users folder and our sample database folder, CSE _ DEPT.

2) Right-click on the Procedures folder and select the New Procedure item.

FIGURE 7.26   The Create Procedure wizard (Copyrighted by Oracle and used with permission).

FIGURE 7.27  The code body for the procedure.

3) In the opened Create Procedure wizard, enter INSERTNEWCOURSE into the Name: box as the procedure’s name, as shown in Figure 7.26.

4) Click on the green plus symbol (+) in the upper-right corner to add all seven input param-eters one by one with the data type shown in Figure 7.26.

5) Click on the OK button to open the procedure code window.

In the opened procedure code window, enter the code shown in Figure 7.27 into the procedure body section, which is just under the BEGIN command. Let’s have a closer look at this piece of code to see how it works.

FIGURE 7.28  The completed procedure, INSERTNEWCOURSE() (Copyrighted by Oracle and used with permission).