This sounds like a simple, straight forward question, but I cannot figure it out. After hours of searching online I am more lost than I started.
I simply want to write some code to produce a result set from my procedure.
This is how the procedure starts:
CREATE OR REPLACE PROCEDURE TEST_PROC
(
Cursor OUT SYS_REFCURSOR,
SDate IN DATE,
EDate IN DATE,
Department IN VARCHAR2,
Users IN CLOB
)
IS
-- ...
Then it goes on the select fields from two different tables, joins them together, applies some filtering, and that's it.
When you want to return a result set from a table you write something like this:
SELECT * FROM TABLE;
I'd like to do something basic and easy like this, but get the data from the stored procedure. I know that when I call the procedure I'd have to provide the parameters.
I am using SQL in TOAD. Can anyone please provide help?
Sample procedure
In Toad when you execute tell it to output the value of your OUT param in the Set Parameters window as seen in the screenshot. This is taken from Toad 12.7 so your dialog may look different, but the option has been there for years to you should have it somewhere in there.