Reputation: 57
I have two tables like Samp1(Parent Table) and Samp2 (Child table)
Parent Table :Samp1
column Datatype Constraint
----------------------------------------
Id Number(6) Primary Key
Child table :Samp2
column Datatype Constraint
----------------------------------------------
Id Number(6) Foriegn Key
Then how to modify column data type Number to Varchar2(10) both parent and child table at a time, can I?
Upvotes: 0
Views: 69
Reputation: 231861
You can't do this in one step. Assuming the tables have data, you'd probably need to do something like
id_varchar
) to your parent tableid
columns from both tablesid_varchar
column to id
in each tableNormally, this would require some downtime since you generally don't want sessions modifying data while you're doing this. If you need to do this online, you could potentially use the dbms_redefinition
package which would involve creating new copies of both tables.
Upvotes: 1