Subject Re: CallableStatement returning same number
Author rrokytskyy
> for (int i=0; i<100; i++) {
> //DOESN'T SEEM TO WORK CallableStatement cs =
> con.getCallableStatement("{CALL SP_TMPOBJ_INSERT()}");
> CallableStatement cs = con.getCallableStatement("EXECUTE
PROCEDURE
> SP_TMPOBJ_INSERT;");
> //cs.registerOutParameter(1, Types.NUMERIC); //UNSUPPORTED?
> cs.execute();
> long lID = cs.getLong(1);
> System.out.println(lID);
> }

I will check this. Probably this is related to the issue that
{CALL ...} is translated to the EXECUTE PROCEDURE. And since I do not
know what parameters are out, there's no result.

registerOutParam is not implemented. The reason is that with current
implementation we have to jump over the head: FBCallableStatement is
subclass of the FBPreparedStatement, which is, in turn, prepared in
the constructor. The correct SQL must be constructed at the time
of "new FBCallableStatement(...)". But escaped syntax does not
provide the info about the IN, OUT and IN/OUT parameters. And
registerOutParam(...) is invoked on the object that already has a
prepared statement and has no effect on it (if we were lucky to get
to this point, because if the parameters specified in the callable
statement do not match the parameters specified in the procedure
definition, for example {call my_proc(?)}, and we had CREATE
PROCEDURE my_proc RETURNS bla INTEGER....).

Best regards,
Roman Rokytskyy