title: Evaluation of PL/SQL boolean variables in Oracle Forms
body: <p>Suppose I have a <code>BOOLEAN</code> variable within a PL/SQL block in an Oracle Form:</p>
  
  <pre><code>DECLARE
    is_viewable BOOLEAN;
  BEGIN
    is_viewable := ...;
  
    IF NOT is_viewable THEN
      raise_my_error(); // pseudo-code
    END IF;
  END;
  </code></pre>
  
  <p>After stepping through this code several times with a debugger, I have determined that <code>raise_my_error()</code> <strong>never</strong> gets called. To clarify:</p>
  
  <ul>
  <li><code>raise_my_error()</code> does <strong>not</strong> get called if <code>is_viewable = TRUE</code></li>
  <li><code>raise_my_error()</code> does <strong>not</strong> get called if <code>is_viewable = FALSE</code></li>
  </ul>
  
  <p>Initial tests suggest that this behavior is limited to PL/SQL code run within Oracle Forms and not PL/SQL code run directly within the database (although I could be wrong).</p>
  
  <p>I can get around this by explicitly comparing <code>is_viewable</code> to <code>FALSE</code>:</p>
  
  <pre><code>IF is_viewable = FALSE THEN
    raise_my_error();
  END IF;
  </code></pre>
  
  <p>I am still curious why <code>NOT is_viewable</code> never evaluates to <code>TRUE</code>.</p>
  
  <p><strong>Update:</strong> It appears that my debugger wasn't showing correct values and that this question is no longer valid. Sorry about that confusion.</p>