Update when using alias fields fails

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lemesos
Posts: 4
Joined: Sat 01 Nov 2008 21:39

Update when using alias fields fails

Post by lemesos » Tue 26 Jul 2011 22:24

Trying to move some projects from my ancient ZEOS components to mydac but I run into problems with Alias fields.

I have this query: select Patient.ID,Patient.pFirst AS PatientNameFirst, Patient.PLast AS PatientNameLast
FROM pattable AS Patient
when I try to make changes as follows:

myquery.edit;
myquery.fieldbyname('PatientNameFirst').asString:='something';
myquery.post;

It fails with
Unknown Column PatientNameFirst in field list.
A lot of these type of queries are created in code so I can not specify the SQLUpdate or it will be very time consuming.
As I said before the old ZEOS has no problem with this. My version is 5.90
Let me know if there is a solution to this.
Thanks

AndreyZ

Post by AndreyZ » Wed 27 Jul 2011 12:22

Hello,

Thank you for the information. We have reproduced the problem and the investigation of the problem is in progress. As soon as we solve the problem, we will let you know. As a workaround, you can remove alias for your table:

Code: Select all

select pattable.ID,pattable.pFirst AS PatientNameFirst, pattable.PLast AS PatientNameLast FROM pattable

AndreyZ

Post by AndreyZ » Mon 05 Sep 2011 11:12

We have fixed the problem. This fix will be included in the next MyDAC version.

Post Reply