Getting a BO publish error in ALTER_TABLE_COLUMN sproc

When publishing the T_ORGANIZATION BO (SQL Server 2012 back-end), an error was viewable from the publish notification in the Notifications portal section (it wasn’t apparent from looking at the BO in the Data Modeler that there was a problem).

ERROR: Could not change length of DB column, ‘CSTACCOUNTNUMBERTX’, for field: BoFieldImpl[name=cstAccountNumberTX,id=1366,Section=BoSectionImpl[name=General,id=BoSectionId[categoryId=1,subCategoryId=1],Business Object=BoImpl[name=Organization,id=103804,module=ModuleImpl[name=Organization,id=10]]]] Existing size: [DbColumnSize.DefaultSize[length=17]] Proposed new size: [DbColumnSize.DefaultSize[length=18]] Caused by: StatementCallback; SQL [
]; Arithmetic overflow error for data type tinyint, value = 299.; nested exception is java.sql.SQLException: Arithmetic overflow error for data type tinyint, value = 299.

Since the change was simply changing the length of text field from 17 to 20 characters, I wouldn’t expect any type of arithmetic overflow. I debugged the underlying stored procedure and found that the variable @index_id needed to be an INT rather than a TINYINT in [DROP_INDEXES_WITH_RESTORE_SQL], [GET_INDEX_COLUMNS], and [GET_INCLUDED_INDEX_COLUMNS].

Continue reading 


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s