I am trying to modify the dataType from NUMBER(10,0) to NUMBER(30,0) against a database with data in these columns. I have to use liquibase for this. I am using the following:
<modifyDataType tableName="tableName" columnName="columnsName" newDataType="NUMBER(38,0)"/>
But for the tables with data in the columns I get the following error:
Caused by: java.sql.SQLException: ORA-01440: column to be modified must be empty to decrease precision or scale
And the column is not migrated. Can columns with data not be migrated to a new type by this method?
Its not liquibase, its the oracle engine which throws this error. Liquibase actually converts modifyDataType
to an alter table statement. So your statement which goes to oracle engine will be like:
ALTER TABLE tableName MODIFTY columnsName NUMBER(38,0);
Now modifyDataType
will return any error returned as a result of the generated sql statement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With