This topic describes how to use the conditional function IS_DIGIT in Realtime Compute.

Syntax

BOOLEAN IS_DIGIT(VARCHAR str)

Input parameters

Parameter Data type
str VARCHAR

Description

Checks whether the specified string contains only digits. If yes, the return value is true. If not, the return value is false. The return value is of the BOOLEAN type.

Example

  • Test data
    e (VARCHAR) f (VARCHAR) g (VARCHAR)
    3 asd null
  • Test statements
    SELECT 
    IS_DIGIT(e) as boo1,
    IS_DIGIT(f) as boo2,
    IS_DIGIT(g) as boo3
    FROM T1;                   
  • Test results
    boo1 (BOOLEAN) boo2 (BOOLEAN) boo3 (BOOLEAN)
    true false false