I am running this query in snowflake and it supposed to return the datatype as integer but returning as decimal.
Query:
select null::integer as int_testing
response:
{
"name": "INT_TESTING",
"attribute_number": 0,
"data_type": "decimal",
"type_modifier": null,
"length": 38,
"precision": 38,
"scale": 0
}
CodePudding user response:
Check the data types since INT is a synonym of NUMBER:
CodePudding user response:
Be careful with casting NULL values, as the value is intended to be UNDEFINED and you might have some unanticipated behavior in your code. Suggest using functions such as NVL() to convert NULL to a designated value.
select nvl(NULL,0)::INTEGER as int_test