Subject Apparent bug in assigning a qry.fieldbyname to a parameter in DSQL
Author Chuck Belanger
Hello:

I have a weird, frustrating apparent bug:

I am using a created IB_Cursor, "qry",  to select from a local database
a singleton. Then with a IB_DSQL I am updating a remote database table.

In the DSQL, I am using parameterized statements (e.g. FieldName and
:FieldName after VALUES).

After Prepare, I assign the values to the parameters, using
qry.fieldbyname('fieldname').asString.

ParambyName('FieldName').asString := qry.FieldByName('fieldname').asString;

On the above line I am getting the error, "Fieldname not found,
FieldName". This is coming from IB_Components.TIB_Row.ByName assertion,
calling GetByName(). I am unable to trace (not able to set break
points--during runtime the breakpoints disappear, F7 does not work) the
IBO code.

On checking both values for ParambyName('FieldName').asString and
qry.FieldByName('fieldname').asString during runtime, they are as
expected. In other words, the field, FieldName, does exist in the qry
dataset.

And the fieldname does exist in both tables.

Any ideas or suggestions on what is going on here?

Sometimes I have found problems resolve by changing from a IB_Cursor to
a IB_Query. That did not resolve this issue.

Thank you,

Chuck


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus