exceptions and triggers
Posted: Thu 23 Aug 2007 14:11
I have added a trigger to one of my tables which checks if the field value fulfills a custom pattern, and if not I put
The field i assign 'error' value to, is a numeric one, so when inserting not correct data in MySQL Query Browser (edit mode) i get a message in the info panel (lower part of result window) where is said "incorrect 'error' value for field...".
When I do it using DBGrid in Delphi, this field is filled with 0 (may be it is any string representation when throwing on numeric field), but I'd like to get any error message or/and prevent from inserting that field into table.
Can it be done with MyDAC? How to design Trigger and Table Field properties? (XP SP2, MySQL 5.0.45, MyDAC 5.10, TurboDelphi)
Michal
Code: Select all
NEW.thatValidatedField = 'error'When I do it using DBGrid in Delphi, this field is filled with 0 (may be it is any string representation when throwing on numeric field), but I'd like to get any error message or/and prevent from inserting that field into table.
Can it be done with MyDAC? How to design Trigger and Table Field properties? (XP SP2, MySQL 5.0.45, MyDAC 5.10, TurboDelphi)
Michal