Is-Of-Type Operator

Returns true if the input sequence matches the identified type.

<sequence> IS OF TYPE (<type>*|+|?,<type>*|+|?,...])

or

<sequence> IS NOT OF TYPE (<type>*|+|?,<type>*|+|?,...)

The is-of-type operator checks the input sequence type against one or more target sequence types. It returns true if both of the following conditions are true:

If the cardinality requirement is met and the input sequence contains a NULL, this operator returns NULL. In all other cases, the result is false.

Note

If the number of the target types is greater than one, the expression is equivalent to OR-ing that number of is-of-type expressions, each having one target type.

For an example of using is-of-type, see Examining Data Types JSON Columns.