Conditional based default value [message #657348] |
Mon, 07 November 2016 04:34 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/ddaec7c9b7a301f4a3bd588d31872015?s=64&d=mm&r=g) |
saipradyumn
Messages: 419 Registered: October 2011 Location: Hyderabad
|
Senior Member |
|
|
Hi All,
I want to add the column with conditional based default value to a table .
Does Oracle supports this functionality ?
Example :
drop table default_test;
create table default_test as
select 'one' name , 1 no from dual connect by level < 4 union select 'two' , 2 from dual connect by level < 4 ;
alter table default_test add new_col varchar2(20) default decode (name,'one','new_one', 'two','new_two','default_value')
Last statement was failing .
Is there any other way to do the same ?
Thanks
SaiPradyumn
|
|
|
|
|
|
|
|