title: How to write a function only used in the where clause that evaluates to true without a comparison operator?
body: <p><strong>My question is:</strong>
  In Oracle regexp_like works alone in the where clause without having to compare to 1 or 0 or a string. The function can only be called when evaluating something in a case statement or the where clause. Since it can't be described (tried searching the data dictionary for it) I'm wondering how to write a function that works the same way.</p>
  
  <p><strong>For example:</strong> </p>
  
  <pre><code>function is_prod
  returns boolean
  is 
    l_var boolean := false;
  begin
    if sys_context('userenv','db_unique_name') = '"PROD_SERVER"' then
      l_var := true;
    end if;
  return l_var;
  end;
  </code></pre>
  
  <p>That function compiles, but cannot be used in a SQL statement like the following:</p>
  
  <pre><code>select *
  from table t
  where is_prod
  </code></pre>
  
  <p>Because I get the following error: ORA-00920: invalid relational operator.</p>
  
  <p>Comparing it to a number or true doesn't work either.</p>
  
  <p><strong>Where can I find the code base for regexp_like or what do I need to do to make this work like regexp_like?</strong></p>
  
  <p>Note: I've looked around for several hours and found that Oracle's regexp functions are actually java calls, but that means they still need a pl/sql wrapper.</p>