Reputation: 12897
Product Version Oracle 10g
I have a table in oracle with some data in it. There is a column which of type Number(10,0). Now i want to change it to Number(10,2) to allow decimals. But to change, oracle is not allowing without deleting the existing data. I know i can take the data backup -> delete data -> change type -> insert data back. But the problem is there is an auto insert column which gets value from a sequence. So when i insert it back those id will change....I am not sure that if anyone is using that id as a key to get the data. So how can i change it without altering the ids..
Please help..
Upvotes: 2
Views: 8183
Reputation: 60262
Upvotes: 5
Reputation: 17643
Probably you want number(12,2) to keep precision. For example, number(7,2) is a number that has 5 digits before the decimal and 2 digits after the decimal.
Alternately, you may disable the trigger / do the work / enable the trigger.
Upvotes: 3