Calling PL/SQL from the OAF page
In this recipe we are going to call some SQL from our page. We will add a button to the page and when a user clicks on the button, we will call a database package that will insert a record into a database table. We will perform the following tasks:
Adding a button to execute the SQL statement
Creating a method in the application module
Calling the method from the controller class
Adding a button to execute the SQL statement
We are now going to create a button. We are going to use the button to call a method that executes the piece of SQL code, which we will add afterwards.
How to do it...
To add a button, perform the following steps:
In the Application Navigator tab, click on the CreateSocietyPG.xml page.
In the Structure pane, navigate to PageLayoutRN | PageButtonRN.
Right-click on PageButtonRN and select New | Item from the pop-up menu:
Click on item1 and set the following properties:
ID:
plsqlButton
Item Style:
submitButton
Prompt:
Call DB Pkg
Now, add the following...