rtnData
is declared in the PL/SQL block, so you don't have to treat it as a bind variable - so it should not have a colon in front of it.
But rtnData
is declared as a type, not as a variable. You don't need your own type, so it should be:
declare
QueryTime DATE;
ErrorNum NUMBER;
ErrorDesc VARCHAR2(2000);
rtnData sys_refcursor;
begin
MyProcedure(to_date('01/01/2010', 'MM/DD/YYYY'), QueryTime, ErrorNum,
ErrorDesc, rtnData);
...
If you're prompted for a form to set rtnData you'll still get that error if you don't set it, or if the parameter is declared as OUT
in the MyProcedure
declaration.
To display the ref cursor in a data grid in Toad, I think you need this:
declare
QueryTime DATE;
ErrorNum NUMBER;
ErrorDesc VARCHAR2(2000);
begin
MyProcedure(to_date('01/01/2010', 'MM/DD/YYYY'), QueryTime, ErrorNum,
ErrorDesc, :rtnData);
...
... and then execute as a script, and choose 'cursor' as the bind type when prompted. I'm not able to test that though. (This suggests it'll work, but not sure why it's declaring the type as it isn't used).