Export and Import using Data Pumps in Oracle 19c

229 Views Asked by At

I have a table in which I want to add a new char type column

Before adding the column took the export , then dropped the table and then recreated the table and then did the import using the same dump file. When I checked the value of new added column in table , it doesn't holds any value. How can I default the value to Spaces in this newly added column.

1

There are 1 best solutions below

0
On

You don't need to drop and recreate the table to achieve this. You can simply alter the table and add the new column. You can also specify what the default value is for the existing values for the column.

alter table mytab add ( col2 CHAR2 DEFAULT '  ' );

However, are you really sure you want the column to have spaces?