Skip to main content

TRY_CAST

Deprecated version

This document refers to a deprecated version of the RQL programming language.

Please go here for documentation related to the latest supported version.

Similar to CAST, but returns null if casting is not allowed.

Syntax
TRY_CAST(<expression> AS <type>)
Example
v: any := 1;
TRY_CAST(v AS double) // 1.0
TRY_CAST(v AS interval) // interval "1 day"

TRY_CAST(v AS time) // null