williey
Technical User
- Jan 21, 2004
- 242
Below is an example of creating a package and procedure using REF CURSOR.
In the package "test_procedure", only test_table is selected. Can I have table joins or views in the SELECT query? Am I only limited to single table query?
------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.
In the package "test_procedure", only test_table is selected. Can I have table joins or views in the SELECT query? Am I only limited to single table query?
Code:
create or replace package test_package
AS TYPE test_type IS REF CURSOR RETURN test_table%ROWTYPE;
END test_package;
/
create or replace procedure test_procedure
(
test_cursor IN OUT test_package.test_type,
test_parameter IN test_table.id%TYPE)
AS
BEGIN
OPEN test_cursor FOR
SELECT *
FROM test_table
WHERE test_table.id = test_parameter;
END test_procedure;
/
------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.