Subject Re: [IB-Java] Re: Escaped syntax for CallableStatement: need your help/input
Author David Jencks
On 2001.12.11 05:11:16 -0500 rrokytskyy wrote:
> > I think since stored procedures differ across db's you can make
> > whatever conventions you want. Is this for execute sp's only? How
> > do select sp's fit into this?
>
> nohow. as far as I understand escaped syntax, it does not define any
> kind of select. current problem with CallableStatement is, that
> escaped syntax allows you define in and out params mixed, and
> then "sort" them using the registerOutParam... And Sun seems to like
> this idea. :(
>
> My first idea to solve the problem was to force people to strip out
> params from the escaped call, and then simply ignore the
> registerOutParam, but this doesn't work if params are mixed. :(

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?

david jencks


>
> So, currently I parse the escaped statement, extract all parameters,
> then using the DatabaseMetaData.getProcedureColumns get info about in
> params, prepare the statement where all in params are variables ('?',
> not constant), then (not implemented yet), redirect all setXXX and
> registerOurParam to parsed params (with XSQLVAR in the back) marking
> them IN and OUT, and, before executing the statement, copy values
> from parsed params into stmt.in_sqlda... Maybe this is overkill.... I
> don't know...
>
> But that's all about the {call myproc(?,...)}, if you pass EXECUTE
> PROCEDURE myproc(...), or (that is not CallableStatement, rather
> PreparedStatement) SELECT * FROM myproc(...), I assume that you know
> what you're doing... :)
>
> BTW, are there parenthesis around params? LangRef says no, but isql
> says yes... :)
>
> Regards,
> Roman Rokytskyy
>
>
>
> To unsubscribe from this group, send an email to:
> IB-Java-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>