The rules to cast between BOOLEAN and other Oracle built-in data types are as follows:
When casting BOOLEAN to numeric :
• If the boolean value is true, then resulting value is 1.
• If the boolean value is false, then resulting value is 0.
When casting numeric to BOOLEAN :
• If the numeric value is non-zero (e.g., 1, 2, -3, 1.2), then resulting value is true.
• If the numeric value is zero, then resulting value is false.
When casting BOOLEAN to CHAR(n) and NCHAR(n):
• If the boolean value is true and n is not less than 4, then the resulting value is ‘TRUE’ extended on the right by n - 4 spaces.
• If the boolean value is false and n is not less than 5, then the resulting value is ‘FALSE’ extended on the right by n – 5 spaces.
• Otherwise, a data exception error is raised.
When casting a character string to boolean, leading and trailing spaces of the character string are ignored. If the resulting character string is one of the accepted literals used to determine a valid boolean value, then the result is that valid boolean value.
When casting BOOLEAN to VARCHAR(n), NVARCHAR(n)
• If the boolean value is true and n is not less than 4, then resulting value is true.
• If the boolean value is false and n is not less than 5, then resulting value is false.
• Otherwise, a data exception error is raised.
You can use the function TO_BOOLEAN to explicitly convert character value expressions or numeric value expressions to boolean values.
Functions TO_CHAR, TO_NCHAR, TO_CLOB, TO_NCLOB, TO_NUMBER, TO_BINARY_DOUBLE, and TO_BINARY_FLOAT have boolean overloads to convert boolean values to number or character types.




