Subject Re: Escaped syntax for CallableStatement: need your help/input
Author rrokytskyy
> I don't see how sun can force you to allow developers to use
> randomized parameter list orders. What spec requirement is
> violated by doing your "first idea"? I thought this stuff was to
> take care of databases (oracle??? not sure) where you could declare
> all your sp parameters in, out, or inout, but (in some versions of
> oracle) couldn't easily determine from the db what the params were,
> so you have to give the jdbc driver some hints. Is it really
> intended to allow you to arbitrarily reorder the parameters of an
> existing stored procedure?

There's nothing in the specs about the order, but consider the code
(that was developed for general case) executed using our driver:

CallableStatement stmt = con.prepareCall("{call myproc(?,?,?)}");
stmt.setInt(1, 10);
stmt.registerOutParam(2, Types.CHAR);
stmt.setString(3, "test");
stmt.execute();

then, if we simply kill the out parameter in the call (we
prepare "EXECUTE PROCEDURE myproc(?,?)" since Firebird has no out
params and isc_dsql_prepare fails on "EXECUTE PROCEDURE myproc
(?,?,?)"), then

stmt.setString(3, "test");

throws an SQLException with message like "Column unknown" or
something like that...

Or am I wrong?

Best regards,
Roman.