updating all columns with default value of schema tables
Hi,
We have a the following requirement
Update the values of application schema tables so that any table with column_type "CHAR" is updated with a default value of " "
and any table with a column_type "NUMERIC" is updated with "0"
This should only happen for columns which already do not have a default value
we were thinking of writing a simple script like following to accomplish this
Select ‘alter table ‘||table_name||’ modify (‘||column_name||’ default 0)’)
From USER_TAB_COLUMNS
Where data_type = ‘NUMERIC’;
but the problem is that it will run this for ALL the numeric columns where it already has a DEFAULT value or not and we dont need that
0