Aradon
07-20-2006, 04:39 PM
*************SOLVED, see second post******************
Hello all,
I've recently just installed mysql on my machine and am slowly learning the ins and outs. I took one database class a long time ago so excuse me for my newbie-ish questions.
I have two tables. One of those tables has a date field that stores a date. I was wondering what type of constraints I could put on this field? Can I somehow get mysql to reject any dates that are before the current date?
In thinking ahead, I thought I might be able to do this with a trigger, however I don't know if a trigger can stop an insert or not. If so, how do you get a trigger to stop an insert. Like if it doesn't meet a constraint in an if statement?
Thanks for your help everyone!
Hello all,
I've recently just installed mysql on my machine and am slowly learning the ins and outs. I took one database class a long time ago so excuse me for my newbie-ish questions.
I have two tables. One of those tables has a date field that stores a date. I was wondering what type of constraints I could put on this field? Can I somehow get mysql to reject any dates that are before the current date?
In thinking ahead, I thought I might be able to do this with a trigger, however I don't know if a trigger can stop an insert or not. If so, how do you get a trigger to stop an insert. Like if it doesn't meet a constraint in an if statement?
Thanks for your help everyone!