Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Trigger question
Datebase: 8i Release 2
OS: Solaris 2.6
I have a column in a table that is defined as VARCHAR2(1). The legal values for this column are 'Y', 'N' or NULL and these are enforced by a check constraint.
In most cases (about 80%) the column will have a 'N' and in my application a null will be treated as if it were a 'N'. That being the case I would like to do a pre-insert trigger which would intercept any 'N' value and insert a NULL instead so that in reality the table would only ever have a 'Y' or a NULL. Is it legal to do this in a trigger?
The application folks already know that they must interpret a NULL just as if it were 'N', so I don't see any repercussions there, but are there other repercussions that I need to think about? Received on Tue Jun 06 2000 - 00:00:00 CDT