View Single Post
Old 11-07-2012, 09:00 PM   PM User | #1
BubikolRamios
Senior Coder

 
Join Date: Dec 2005
Location: Slovenia
Posts: 1,876
Thanks: 114
Thanked 76 Times in 76 Posts
BubikolRamios is on a distinguished road
Before insert trigger

Got fields a,b, both in primary key.

Code:
insert into t (a) values ('foo')
will not work --> column b can not be null.

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:
1. insert
2. check for various things like 'can not be null'
3. Before insert trigger is triggered

What I would expect:
1. insert
2. Before insert trigger is triggered
3. check for various things like 'can not be null'
__________________
Found a flower or bug and don't know what it is ?
agrozoo.net galery
if you don't spot search button at once, there is search form:
agrozoo.net galery search

Last edited by BubikolRamios; 11-07-2012 at 09:11 PM..
BubikolRamios is offline   Reply With Quote