Page 1 of 1

exceptions and triggers

Posted: Thu 23 Aug 2007 14:11
by m227
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

Code: Select all

NEW.thatValidatedField = 'error'
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

Posted: Mon 27 Aug 2007 07:12
by Antaeus
I could not reproduce the problem.
Please send me a complete small sample at evgeniyD*crlab*com to demonstrate it, including script to create the table with the trigger.