Is it possible to create a default constraint on a table based on some conditional logic.
For example:
CREATE TABLE TEST_T( DEPT_NO NUMBER,
GRANT_FL CHAR(1)
);
DEPT_NO GRANT_FL
10 Y
10 Y
0 N
I want the DEPT_NO to be populated with a default value of 10 only when GRANT_FL = 'Y' Otherwise Set it to 0.
I can do this with a After Insert Trigger but would be better if this can be done via case statement which sets a default value.
Thanks Much!
Kevin