All Forums Database
sinara 7 posts Joined 10/15
09 Mar 2016
Howto check if decimal is valid value

Hi All,
How to check if the given decimal is valid. I usually do a case statement like below to check if column is invalid or NULL then set it to 0 else take it as it is:

case when decimal_column is NULL or decimal_column NOT BETWEEN -999999999999 AND 999999999999 then 0 else decimal_column end

 

Can anyone please let me know if the above query looks correct

 

Thanks

yuvaevergreen 93 posts Joined 07/09
11 Mar 2016

Try regex, if yours is 14.10 version...
SEL REGEXP_SIMILAR('111','\d\d\d','i')
 
 

You must sign in to leave a comment.