Skip to Content
avatar image
Former Member

Error im mapping when storing large numbers as decimal values

Hello

I'm am currently working in a project where we have to store large values in some colums using DataServices. The datatype of the column is decimal(30,0).

To get an idea of my problem I simplified it:

I created a test file with a the colums 'test_id' and 'test_number' as well as a table in our database with the same colums. In the query I did the mapping for 'test_number' like this: 100000000000000000000000000000 * 2 + 1000000000000000000000000000 * 2 because '202000000000000000000000000000' is the value I need in the database.

Unfortunately this dindn't work. I got the following error:

[Query:q_test_decimal] Invalid mapping expression for column <q_test_decimal.test_number>. Additional information: <A numeric's maximum number of digits is <28>. You are attempting to store value or constant <1000000000000000000000000000>, whose <29> digits exceed the maximum. 1 error(s), 0 warning(s). Check and fix the syntax and retry the operation. (BODI-1112394)>. (BODI-1111081)

When I do the mapping directly with 202000000000000000000000000000, everything works fine. But as soon as I put in the addition above, I get the error...

The simplified DataFlow: dataflow.png

The Mapping and error message: mapping-errormessage.png

Thanks for your help!

dataflow.png (10.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Feb 19 at 03:59 PM

    Some more details about my envoronment: I installed the 64 bit version of DataServices and the system type of my laptop is a x64-based PC. This information may help because when I execute the job above with other laptops everything works fine.

    And another topic I found out is that when I do the mapping with '100000000000000000000000000000 * 2 + 1000000000000000000000000000.00 * 2' also everything works fine.

    So the problem seems to be that the second digit used in the addition needs to have exactly 30 decimal positions, so that DataServices performs the operation right. But from my perspective, this is a very odd behaviour. And when executing the job with another laptop, I don't need add the positions of the second digit after the comma...

    Maybe someone can help me with the added information above.

    Kind Regards,

    Jonas

    Add comment
    10|10000 characters needed characters exceeded