Subject Re: [IBO] Array Columns - as Parameters
Author Claudio Valderrama C.
""Geoff Worboys"" <geoff@...> wrote in message
news:<005401c15521$caa95020$0201950a@hex>...
> Hi Jason,
>
> I found (at least one of) my problems, I was trying to assign an array
> from a Fields column to a Params column. With an array parameter the
> ArrayDesc does not get defined. See this code...

[snip]

> For parameter columns the PSQLVAR.RelName and PSQLVAR.SQLName values
> are not defined, and even if they were there is no guarantee that the
> parmeter name matches the field name.

Arghh!!!
This resembles the Kovalenko/Yemanov "IB singularity", a kind of black hole
in the engine that swallows useful information about array columns,
apparently at the DSQL layer, when a cursor is bound to a statement. You
will get both table and column names being blank or trash. The first demo
(from Dmitry Kovalenko's instructions; he's the maker of the OLE/DB provider
for IB/FB) was solved by ensuring BCB had the default 4-byte alignment, if I
remember well, or it would misuse the information from the LIB file.

Since I was suffering from language impedance, I had to request FB
contributor Dmitry Yemanov's help to understand the problem on behalf of me,
directly in Russian from Mr. Kovalenko. But later, D. Yemanov himself
produced a modified example that I couldn't fix in the client program (a
modification of the API10.C program that comes in the "examples\API" dir
with IB/FB) because I couldn't find anything wrong, hence I blamed the
engine when it binds the cursor before updating records (the program invokes
isc_dsql_describe_bind). Peeking inside the engine at such time is no fun,
since you deal mostly with arrays of raw data and I'm still not fluent when
it comes to interpret hex memory dumps in real-time. :-)

I hope Dmitry sent the case to "Mom" as agreed. Still not sure if this is a
limitation or a bug.


> I dont know if there is a better way to achieve this and I am not sure
> if there is anything that can be done in IBO to avoid this requirement
> for array parameters. If not then the restriction should be noted in
> the documentation, perhaps it should be obvious but I did not realise
> it.

You should have known that fact since the day you were born, Geoff, how do
you expect utterly obvious issues to be thoroughly documented?
:-)
Maybe IBO can solve in some elegant way the problem of the arraydesc not
being assigned, but for the empty or dirty relation's name and field's name,
it will have to provide a workaround if it's desirable, because this is an
issue in the engine.

C.
---------
Claudio Valderrama C.
Ingeniero en Informática - Consultor independiente
http://www.cvalde.com - http://www.firebirdSQL.org