Oracle Boolean: How to Assign Values in Oracle

There is no native boolean data type in Oracle databases, so typically numbers or characters are used to represent boolean values. A common approach is to use the NUMBER data type, where 0 represents false and 1 represents true. Alternatively, the CHAR data type can be used, for example using Y to represent true and N to represent false.

For example, you can use the following statement to declare a variable and assign it the value true:

DECLARE
  is_active NUMBER := 1;
BEGIN
  -- do something
END;

Or, use character types to represent:

DECLARE
  is_active CHAR := 'Y';
BEGIN
  -- do something
END;
bannerAds