With BDE, i can modify the generated query at SQLInsert, SQLUpdate or SQLDelete. Especially when I wanted to do some cascading delete or update.
Something like this:
-- I added this
DELETE table_detail
WHERE field1 = :old_key1
-- automatically generated
DELETE table_master
WHERE field1 = :old_key1
However, it does not work with MyDac. Error. And I can't use semicolon to separate each command either.
Need help, please.
Trouble with TMyQuery.SQLDelete
-
swierzbicki
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
Delphi and MyDAC don't allow such complex statements in SQLDelete. It's implied that only one record in the simple dataset is processed. To solve your problem try to use stored procedure or trigger (if your MySQL server supports them), or try to handle BeforeDelete event of your dataset, or any other manual way.