wood burning stoves*
The moose likes JDBC and the fly likes problems while passing the parameters to an oracle procedure Ref Cursor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problems while passing the parameters to an oracle procedure Ref Cursor" Watch "problems while passing the parameters to an oracle procedure Ref Cursor" New topic
Author

problems while passing the parameters to an oracle procedure Ref Cursor

Mahmood Ali
Greenhorn

Joined: Aug 04, 2010
Posts: 16
Hello All,

I am having troubles while passing parameters to an oracle procedure and retruning the values in a ref cursor. The result set is returning a false statement and did not return any value. . I am having year, username parameters which I am passing them to the procedure.

my code is


and here is my procedure which is processed successfully



Can you please help in this matter while passing the parameters.

Thanks in advance
Sudheer Bhat
Ranch Hand

Joined: Feb 22, 2011
Posts: 75
Did you try running the SQL in the procedure either from SQL*plus or any of the GUI tools for a sample year_v and usr_v values? Does it return values??
Mahmood Ali
Greenhorn

Joined: Aug 04, 2010
Posts: 16
How do I run this procedure from toad?
Sudheer Bhat
Ranch Hand

Joined: Feb 22, 2011
Posts: 75
declare

l_refcur SYS_REFCURSOR; -- if your cursor is weakly typed. Else the declaration will be l_refcur Types.cursor_type

begin

p_get_budget_p(<value for year>, <value for usr_v>, l_refcur);

-- try fetching the value from refcur. If you are not getting any values, then you have a problem with your procedure. You need to be fetching the into a record type which contains all the fields selected by the SELECT statement with proper datatypes.

end;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problems while passing the parameters to an oracle procedure Ref Cursor