Subject | RE: [ib-support] "Unknown error" during procedure execute... |
---|---|
Author | RRokytskyy@skillberry.com |
Post date | 2001-07-16T10:40:23Z |
Hi,
example in one of "old" IB's (either 4.2 or 5.1) docs. I just needed a
procedure to test the JDBC's CallableStatement. That was the first that came
to my mind. :)
So, now my second question (sorry :-)):
How can I get output parameters from a "normal" procedure (not "select"
one)?
Currently I'm working on the Firebird JDBC driver's CallableStatement and
I'm looking for the right solution of getting output parameters from
procedure execution.
Currently the JDBC driver uses the isc_dsql_execute2() API call, but if we
have the procedure with RETURNS statement, without SUSPEND in the body and
the call is "EXECUTE PROCEDURE" instead of "SELECT * FROM" I receive the
isc_port_len (335544358L) error code with message "Message length error
(encountered <long>, expected <long>)".
Is this a correct behaviour? Are there any things that I should be aware of?
Thanks in advance,
Roman Rokytskyy
> Maybe it would help to use:Yep, this does work! Thanks!
>
> IF (NOT temp IS NULL) THEN BEGIN
> IF (temp > 0) THEN
> SELECT RESULT FROM factorial(:temp) INTO :temp;
>
> instead of:
>
> IF (NOT temp IS NULL) THEN BEGIN
> IF (temp > 0) THEN
> EXECUTE PROCEDURE factorial(:temp) RETURNING_VALUES :temp;
> Be aware that you can only pass values up to 12 (with IB5.6 or IB6,No, that's definitely not about the factorial :) Factorial procedure was an
> dialect 1) or up to 20 (IB 6 dialect 3) to this procedure since
> otherwise the result won't fit into an integer...
>
> And if it's about a factorial proecure wouldn't it be easier to do:
example in one of "old" IB's (either 4.2 or 5.1) docs. I just needed a
procedure to test the JDBC's CallableStatement. That was the first that came
to my mind. :)
So, now my second question (sorry :-)):
How can I get output parameters from a "normal" procedure (not "select"
one)?
Currently I'm working on the Firebird JDBC driver's CallableStatement and
I'm looking for the right solution of getting output parameters from
procedure execution.
Currently the JDBC driver uses the isc_dsql_execute2() API call, but if we
have the procedure with RETURNS statement, without SUSPEND in the body and
the call is "EXECUTE PROCEDURE" instead of "SELECT * FROM" I receive the
isc_port_len (335544358L) error code with message "Message length error
(encountered <long>, expected <long>)".
Is this a correct behaviour? Are there any things that I should be aware of?
Thanks in advance,
Roman Rokytskyy