TXDataSet Update when using a field Alias

I am in the process of converting an application to use the RemoteDB components and one issue I have hit is if I set a TXDataset SQL using a field alias, the update fails as it tries to post using the alias rather than the real fieldname.
So if for example the SQL is set to...
SELECT customer,customeraddress1 as cust_add1 FROM customermaster
I change address value then upon TXDataset.Post I get an exception "Column Unknown CUST_ADD1"

TXSQLGenerator.GetUpdateSQL produces an update statement of:
'UPDATE customermaster SET CUST_ADD1 = :p1 WHERE (CUSTOMER = :w1)'

TMS RemoteDB can't tell what is the original name of the field. It can be actually anything, like an aggregated expression or even a complex expression.

In this case, you will have to build and execute the Update SQL yourself, using the OnRecordUpdate event.

OK thanks I will do that

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.