Before insert trigger
Got fields a,b, both in primary key.
Have trigger on table t, before insert, which assigns value to b
same thing will not work --> column b can not be null.
Trigger on before insert is not even triggered, tested.
I guess what I would expect is, having trigger as described, insert should work ?
EDIT: (in short)
It works like this:
2. check for various things like 'can not be null'
3. Before insert trigger is triggered
What I would expect:
2. Before insert trigger is triggered
3. check for various things like 'can not be null'
Show the actual trigger.
SHOW CREATE TRIGGER triggername;
The docs say it can work if done correctly.
Oops...forgot: My table was created thus:
But by doing it this way, the trigger effectively overrides the default value, so the default value is of no consequence.
Hmm, yes, sorry to waste your time, I'm using great client for mysql which enables me to import .csv via it. But unfortunately that part is crappy, specialy if there is error in .csv format.
And that was the cause of all troubles.
|All times are GMT +1. The time now is 01:13 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.