to_boolean()

Scalar. Converts a given value to a Boolean value.

Syntax

to_boolean ( value )

Parameter

value

A string, or a Boolean value.

Usage

Converts a given string to a Boolean value. The function takes a string as its argument, and the function returns a Boolean value. Note that the function can also take a Boolean value as its argument, but it will return the same Boolean value.

The strings "True", "Yes", and "On", regardless of case, or the numeral "1" returns TRUE. NULL returns NULL. Any other string returns FALSE.

Examples

to_boolean ('1')returns TRUE.

to_boolean ('FALSE')returns FALSE.

to_boolean ('example')returns FALSE.