15-6. Calling a Java Stored Procedure from PL/SQL
Problem
You want to access a Java stored procedure from within one of your PL/SQL applications. For instance, you are creating a PL/SQL procedure, and you want to make a call to a Java stored procedure from within it.
Solution
Make a call to the Java stored procedure using the call specification that you created for it. The following code demonstrates a PL/SQL package that makes a call to a Java stored procedure and then resumes PL/SQL execution once the call has been made.
CREATE OR REPLACE PROCEDURE employee_reports AS
CURSOR emp_cur IS
SELECT first_name, last_name, email
FROM employees
WHERE department_id = 50;
emp_rec emp_cur%ROWTYPE;
BEGIN DBMS_OUTPUT.PUT_LINE('Employees ...
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.