Hi,
in db2 v8.2 fp11 on Linux I would like to add default value to one column.
Sample:
Code:
COL_A COL_B
0 0
1 1
2 1
3 1
etc.
So if column A has 0 then column B gets 0, but if column A has value > 0 then column B gets 1.
I know I can define formula, but some applications are already inserting values to COL_B so I don't want to change any application.
So is there any option to use default for some "case" statement way - like "alter table mytable alter column colb set default case when a = 0 then 0 else 1 end"?
I know I can write trigger, but is there a default option that I could use just like in formula?
Thanks,
Grofaty