[fpc-devel] Fix to IBConnection field names

Michalis Kamburelis michalis at camelot.homedns.org
Fri Mar 18 16:31:16 CET 2005


Hi

(This is completely unrelated to my previous patches to sqldb and
ibconnection.)

A simple correction that fixes a problem in IBConnection with field
names: in TIBConnection.LoadField you look for field names using
SQLDA^.SQLVar[x].AliasName, but in TIBConnection.AddFieldDefs you create
fields with names using SQLDA^.SQLVar[x].SQLName. This is not good, as
field's SQLName may be '' while it's AliasName may be 'COUNT' or
something like that. In general, I think that you should use AliasNames
everywhere. This also gives developer (the one who writes SQL
statements) ability to change default field names using SQL (since you
can explicitly say in select SQLs what AliasName should be used for some
fields).

So the fix is (I don't attach a patch, since this is too small..):
change in TIBConnection.AddFieldDefs implementation "SQLName" to
"AliasName". This way in whole IBConnection unit only AliasName of
fields is used, never SQLName.

Michalis.






More information about the fpc-devel mailing list