Page 1 of 1

refresh one record

Posted: Mon 10 Dec 2007 21:15
by ben
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

Posted: Wed 12 Dec 2007 17:00
by Antaeus
You should provide the correct SQLRefresh statement (and, probably, SQLInsert, SQLUpdate, SQLDelete statements) for complicated select queries.

Posted: Sun 16 Dec 2007 17:52
by ben
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?

Posted: Mon 17 Dec 2007 10:10
by Antaeus
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.