Skip to main content

I've noticed that while creating UNIT tests with mock data that data columns which have the domain with Data type decimal do not show up in the mock tests. 


In this example on the table “voorraad” i have a column named “voorraad_aantal”

When changing the datatype of the domain from decimal to numeric the column does show up.

 

 

when looking into the table “data_set_col_selection” which is what you see

 

then script shows during creation that it has the following when statement
 

it checks the table dttp if the .calulated is 0

 

when checking the dttp table with the following query

select 
dt.prog_lang_id
,dt.dttp_id
,dt.calculated
from dttp dt
where dt.dttp_id in ('NUMERIC', 'DECIMAL') and dt. prog_lang_id = 'SQL'

the result shows that for decimal the value is null and for numeric is 0

 

Is there a reason for this? it the use of numeric preferable? 
In the current model that I'm working in the datatypes are all set to DECIMAL. Changing this to NUMERIC fixes the problem with being unable to create unit tests.

Hi Pieter Jan,

According to this link, Decimal and Numeric are interchangable: decimal and numeric (Transact-SQL) - SQL Server | Microsoft Learn

They should indeed behave the same, but you have found a case where it does not. 

However, if I inspect the DTTP (Datatypes) we distribute, I see we do not have a record for Decimal. According to our SF archive, it was never distribued as part of the installation package, meaningthat is was manually added by someone.

If you do wish to use Decimal, ensure the settings of this dttp record match that of Numeric, however, that does not guarantee it will work exactly the same accross all processes as sometimes logic has to react differently based on the chosen dttp. Migrating to Numeric might be a good alternative to consider. 

Hope this helps!


Hi Mark,

 

Thanks for the reply!
It seems the record of NUMERIC was changed once back in 2013.. so perhaps it's some legacy fault. 
For now if I encounter the problem I'll change the decimal to numeric.