Skip to main content

IS_ERROR

Introduced or updated: v1.2.379

Returns a Boolean value indicating whether an expression is an error value.

See also: IS_NOT_ERROR

Syntax

IS_ERROR( <expr> )

Return Type

Returns true if the expression is an error, otherwise false.

Examples

-- Indicates division by zero, hence an error
SELECT IS_ERROR(1/0), IS_NOT_ERROR(1/0);

┌───────────────────────────────────────────┐
│ is_error((1 / 0)) │ is_not_error((1 / 0))
├───────────────────┼───────────────────────┤
truefalse
└───────────────────────────────────────────┘

-- The conversion to DATE is successful, hence not an error
SELECT IS_ERROR('2024-03-17'::DATE), IS_NOT_ERROR('2024-03-17'::DATE);

┌─────────────────────────────────────────────────────────────────┐
│ is_error('2024-03-17'::date) │ is_not_error('2024-03-17'::date)
├──────────────────────────────┼──────────────────────────────────┤
falsetrue
└─────────────────────────────────────────────────────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today