MySQL Forums
Forum List  »  Triggers

need help 'before insert'
Posted by: raoul benneth
Date: September 13, 2006 07:54AM

Hi all :)

Im newbie in mysql and a lot more newbie on triggers :( so.. i need some help to create a trigger before an insert:

In a table, i have 4 columns where i need to control the value before insert new value:

firstIn firstOut secondIn secondOut

in 'human' terms, i've to do the follow:

if new_firstIn == old_firstIn dont insert and show me some message.

I need this before insert and not before update, because for the different "jobs", the firstIn can be different, for ex.:

job = 1; firstIn = 10.00
job = 2; firstIn = 11.00

"job" is in relation with an ID so:

ID = 1; job = 1; firstIn = 10.00;
ID = 1; job = 2; firstIn = 11.00;
ID = 1; job = 3; firstIn = 10.00; <-- i need to prevent this!

Any suggest?

Thx a lot.

Raoul.

Options: ReplyQuote


Subject
Views
Written By
Posted
need help 'before insert'
2120
September 13, 2006 07:54AM
1511
September 18, 2006 08:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.