Subject Re: [Firebird-Java] Re: Insert ... returning ...
Author Roman Rokytskyy

> I suspect that, in the fixing the "insert...returning..." problem, was
> introduced a new problem.
> The query below works properly in ISQL and in version 2.1 of JayBird,
> but in version on the CVS causes the exception "GDS Exception.
> 335544583. SQLDA missing or incorrect version, or incorrect number/type
> of variables"...

Interesting. Do you have a test case for me (I need your database
schema, but not the data)?

There was a report for the similar problem from SAS and the issue was
the fact that Firebird does not report the XSQLVAR variables in their
order though it expects later the "restart from parameter N" call if
things do not fit the maximum buffer size (I guess 32k or 64k). It had
been fixed in Firebird HEAD but the bug affects all previous versions
(including 2.0, all 1.5.x and 1.0.x and, very likely, all InterBase

You are correct assuming that it is related to the bug with
insert/returning statement, since I have added additional sqlinfo
parameter. It seems that the reply no longer fits the original buffer.
The NullPointerException happens later and is more or less an indicator
of the bug I'm talking about.

There's workaround - allocate 32k buffer for sqlinfo structure, but it
works only for the cases where the complete description of output params
fits the buffer.

Therefore it would be really-really great if you can send me the
database (no data are needed) and short Java code so we can check
whether the bug is there or it is something different. If that is the
bug in Firebird that is already fixed, I will simply increase the the
buffer to make it work with with old Firebird versions. If that's
something different, I have to check more carefully.

Another way to confirm my suspect is to modify the aliases you have in
your select - make them very short (e.g. one letter) and probably reduce
a number of columns. At some point it fits the buffer and it will work.