Subject Re: [IBO] Problem with field alias in 4.9.13 Beta 25
Author Thomas Steinmaurer
> after upgrading to 4.9.13 Beta 25, it seems there is something messed up
> when accessing a field in a result set by field alias name.
>
> With a TIB_Cursor. The following SQL statement:
>
> select
> count(rdb$trigger_name) as anzahl
> from
> rdb$triggers
> where
> rdb$trigger_name=:trigger_name
> and rdb$relation_name=:relation_name
>
>
> Using the cursor like that:
>
>
> c1.Close;
> c1.ParamByName('trigger_name').AsString := ATriggerName;
> c1.ParamByName('relation_name').AsString := ATableName;
> c1.First;
> Result := c1.FieldByName('anzahl').AsInteger> 0;<= exception here
>
>
>
> Worked fine with e.g. 4.9.8.

The bad thing is, I can't reproduce with a simple application
(TIB_Connection, TIB_Cursor).

While I can't access the result field in my production application by
name, I can by field index => .Fields[0].AsInteger. The interesting
thing is, that .Fields[0].FieldName equals to 'RDB$RELATION_NAME' and
NOT 'anzahl'.

Weird.


Thanks.

--
With regards,

Thomas Steinmaurer
Upscene Productions
http://www.upscene.com
http://blog.upscene.com/thomas/

Download LogManager Series, FB TraceManager today!
Continuous Database Monitoring Solutions supporting
Firebird, InterBase, Advantage Database, MS SQL Server
and NexusDB!