Support Article
Unable to import rap file in DB2 server with double property
SA-31885
Summary
Create a property in a class and mark the property type as double.
Now optimize this column for reporting in a postgres server. Note that it creates the column with datatype as numeric(38,9). Now take a rap containing this property and class and try to import this rap in a DB2 server. This gives an error
Error Messages
Log file Error : DB2 SQL Error: SQLCODE=-604, SQLSTATE=42611, SQLERRMC=DECIMAL (38, 9), DRIVER=4.16.53 is the error obtained while importing on a db2 server
Steps to Reproduce
1. Create a property with Data type as Double in PRPC.
2. Optimize the property for reporting.
3. Create a RAP from the environment in which property has been optimized for reporting with Database as Postgres.
4. Import RAP in DB2 database server.
Root Cause
In DB2 database server "Numeric" data type has a precison of 31, in other database servers like postgres and Oracle precision is more than 31.
When a Rule-Admin-Product (RAP) is generated from database servers which has more precision that the target database server, there would be a mismatch, which causes the RAP import to abort due to an error.
Resolution
Alter the DDL statements to match the precision of the target database and re-run the statements:
Best Practice: As a best practice, define the data type within 0-31 precision range, which will eliminate issue with other database servers, thus allowing the RAP or other operations within different database servers to be consistent.
Published January 4, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.