Check constraint
Posted in 1999
Topics: Triggers, Constraints & Referential Integrity
I am trying to put check constraint on date column but it returns following err Error 201 : general syntax error check constraint reads as - trans_date >= today Can u help me put this type of check constraint on date column? Thanks ______________________________________________________________ what is achieved , was not aimed for !
Shevkar, Mukund wrote: > > I am trying to put check constraint on date column but it returns following > err > Error 201 : general syntax error > > check constraint reads as - trans_date >= today > > Can u help me put this type of check constraint on date column? You cannot use today in a check constraint like that. It is not even a sensible constraint since every row would become a violation the day after it was inserted! If you really must make such a constraining condition on insert either use a 'default today' clause and do not let users enter an actual date and/or use an insert trigger and an update trigger to perform the check on insert or update only. Art S. Kagel