Subject Re: Escaped syntax for CallableStatement: need your help/input
Author rrokytskyy
> 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. :(

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