Changing the data type for data columns in Oracle using Liquibase

I am trying to change dataType from NUMBER (10.0) to NUMBER (30.0) against a database with data in these columns. For this I have to use lipibase. I am using the following:

<modifyDataType tableName="tableName" columnName="columnsName" newDataType="NUMBER(38,0)"/>

But for tables with data in 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 wrapped. Can data columns not be migrated to a new type using this method?

+5
source share
2 answers

Its not lipibase, its oracle engine that causes this error. Liquibase actually converts modifyDataTypeto an alter table statement. So your statement that goes into oracle engine will look like this:

ALTER TABLE tableName MODIFTY columnsName NUMBER(38,0);

modifyDataType , sql.

+1

, , . IFF, - NUMBER (N, 0), N < 38.

0

All Articles