stored procedure ref cursor

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
belaruska
Premium Member
Premium Member
Posts: 12
Joined: Wed Feb 28, 2007 5:00 pm

stored procedure ref cursor

Post by belaruska »

i am using ODBC stage to call a stored procedure. it has 2 input parameters and an output ref cursor. i used manager to define metadata, but it only shows two input parameters. when i call the procedure with just 2 input parameters, it gives me error: ORA-06550: PLS-00306: wrong number or types of arguments. when i manually add an output parameter and call it in sp, it gives me the error: ORA-01008: not all variables bound.

i've also defined the columns for the output based on the table definition.

am i missing something?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What kind of variables are these? I think ODBC stage can only support IN and IN/OUT parameters for stored procedures. Do you have STP stage?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
belaruska
Premium Member
Premium Member
Posts: 12
Joined: Wed Feb 28, 2007 5:00 pm

Post by belaruska »

DSguru2B wrote:What kind of variables are these? I think ODBC stage can only support IN and IN/OUT parameters for stored procedures. Do you have STP stage?
there are two IN variables, and ref cursor is OUT
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Read about stored procedure calls in ODBC help guide. I am pretty sure OUT parameter is not supported. But I can be wrong.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
belaruska
Premium Member
Premium Member
Posts: 12
Joined: Wed Feb 28, 2007 5:00 pm

Post by belaruska »

DSguru2B wrote:Read about stored procedure calls in ODBC help guide. I am pretty sure OUT parameter is not supported. But I can be wrong.
but even when i use STP stage I get the same errors.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Are you able to execute the stored proc. successfully and capture the OUT parameter from your favourite sql tool.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
belaruska
Premium Member
Premium Member
Posts: 12
Joined: Wed Feb 28, 2007 5:00 pm

Post by belaruska »

DSguru2B wrote:Are you able to execute the stored proc. successfully and capture the OUT parameter from your favourite sql tool.
when i execute the sp from sqlplus, i have to define a variable:

sql> variable v refcursor
sql> exec stor_proc (in_par1, in_par2, :v)

it works; and to see the result:

sql> print v
Post Reply