Skip to main content

Column with DECIMAL Domain is not available in mock data


Forum|alt.badge.img

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.

Did this topic help you find an answer to your question?

2 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23

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!


Forum|alt.badge.img

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings