WELL I NEED TO CREATE A TRIGGER ON TABLE RESERVATION IT DOES NOT ALLOW DATE LESS THAN CURRENT DATE.
MY TRIGGER IS :
mysql> create trigger reserve_trigger before insert on reservation
-> for each row
-> begin
-> if(new.Journey_Day<curdate())
-> then
-> set NEW="Jouney Date Should not be less than current date";
-> end if;
-> end //
Query OK, 0 rows affected (0.00 sec)
mysql> insert into reservation values ("ppno00005","FSA03","2012-02-09","ECONOMY","MC001","SC003")//
ERROR 1231 (42000): Variable 'new' can't be set to the value of 'Jouney Date Should not be less than current date'
I TRIED TO PRINT MESSAGE USING
signal sqlstate '45000' set message_text ="invalid entry";
BUT I REALIZED IT DOESN'T WORK FOR MY VERSION OF SQL. IS THERE A BETTER WAY OF DOING IT.