refresh one record

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

refresh one record

Post by ben » Mon 10 Dec 2007 21:15

Hello,

I have a complicated query with left join and fields like

... members.prepaymoney, date(members.lastseen) as lastdate, ...

the problem with those queries is that I cant refresh one record only. They recognize the alias "lastdate" as field and they return an error:

EMyError:
#42S22Unknown column 'lastdate' in 'field list'

version: 5.20.0.12
mysql: 5.0.41

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 12 Dec 2007 17:00

You should provide the correct SQLRefresh statement (and, probably, SQLInsert, SQLUpdate, SQLDelete statements) for complicated select queries.

ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Post by ben » Sun 16 Dec 2007 17:52

this is no correct or wrong. I join two tables that has the same field name so I have to use "AS" to seperate them. Its something like

SELECT members.name as membername, categories.name as categoryname FROM members
LEFT JOIN categories...

what is correct and what is not here?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 17 Dec 2007 10:10

We found a bug concerning auto-generated queries. It will be corrected in the next MyDAC build. Most likely it will fix the problem you have encountered.
ben wrote:what is correct and what is not here?
I mean the wrong statement sent by MyDAC to the server. To solve this problem, you should catch this query, fix it, and assign it to the RefreshSQL property of your DataSet component.

Post Reply