135
Views
5
Comments
Get 0 from database with data type is numeric

Hi All,


How can i get data 0 from database field column with data type numeric,

because in OutSystems entity with data type numeric 0 = null 


Regards,

Kane

2021-11-18 18-03-41
AJ.

Hello @Kane Loony 

Maybe I did not understand your question, but if the attribute data type is 'Integer' for e.g, then the UI does display a 0 as a 0.

When you set the data type for an attribute in your entity 'Numeric' is not an option, so please clarify if you meant a different data type such as Integer, Long Integer, Decimal or Currency?

Regards,

AJ

2020-11-13 06-20-57
Kane Loony

Hi Aj,


I mean data type is decimal,


Regards,

Kane

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Kane,

It is actually the other way around.

OutSystems does not use the concept of the NULL value, except for the Entity Identifier data type. Therefore, each data type has an associated default value that is assigned at creation.

For numeric data types the default value is ways 0.

So if you want to distinguish a null from 0z you need an extra Boolean attribute for that.

Regards,

Daniel

2020-11-13 06-20-57
Kane Loony

Hi,


Therefore I want to find data with a value of 0, because if I look for the value of 0 it cannot be because it will return the NULL value


Regards,

Kane

2018-10-18 08-34-00
Eric Bulters
 
MVP

Hi Kane,

As others have mentioned.
OutSystems does not have Null values. For numeric (integer) data values it uses 0 and for decimals it uses 0.0

So when looking for 0 it should return all numeric fields that are 0 or Null.

If you are migrating data from an external database and want to differentiate between 0 and Null you will need a boolean flag like Daniel mentioned.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.