I have a stored procedure that has 1 output value:
getCount @totalCount int = null output,
@option1 int = 0,
@option2 int = 0
There is no result set, just the output value and a return
status of a 0 or 1.
I am using the SybCallableStatement:
SybCallableStatment stmt =
(SybCallableStatement)con.
prepareCall("{? = call getCount @totalCount=?}");
I register the status and output values:
stmt.registerOutParameter(1, Types.INTEGER);
stmt.registerOutParameter(2, Types.INTEGER);
Execute:
boolean execStat = stmt.execute();
I can get the procedure status:
stmt.getInt(1);
If I try to get the output value
stmt.getInt(2);
I get the JZ0SG error
A CallableStatement did not return as many output
parameters as the application had registered for it.
I exec a similar statement via an isql statement and I get
both the status and the output value back.
I can not see where there is an error in what I am doing.
Any help would be appreciated.
Could you get a RIBO TDS trace of this run?
What happens if you execute:
prepareCall("{? = call getCount(?) }");
I don't know if jConnect can parse out the second "?" parameter placeholder.
With a current jConnect 6.05 version you can use the parameter name in the
registration,
this is optional:
> stmt.registerOutParameter("Return_value", Types.INTEGER);
> stmt.registerOutParameter("@totalCount", Types.INTEGER);
Try the call syntax in the prepareCall to see if it works.
-Paul
<Kevin McGinn> wrote in message news:478ff7c8.1e1...@sybase.com...