What would you use to place a not null constraint on a column? If the column is left blank on insertion, it should display a custom error message.
1. Rule
2. CHECK Contstraint
3. Triggers
4. Alter the table so that the column does not allow null
Printable View
What would you use to place a not null constraint on a column? If the column is left blank on insertion, it should display a custom error message.
1. Rule
2. CHECK Contstraint
3. Triggers
4. Alter the table so that the column does not allow null
What would you use to place a not null constraint on a column? If the column is left blank on insertion, it should display a custom error message.
1. Rule
2. CHECK Contstraint
3. Triggers
4. Alter the table so that the column does not allow null[/QUOTE]
The best thing to do is to add a NOT NULL constraint on the column.
debasisdas,
How do you then display a custom error message?
If you check for null in a trigger you can raise it with raiseerror(), though not sure if it is the best way to do that.