returns a TRUE value, if the operation result must be negated after
evalution.
<P></P></DL>
<P>To evaluate the <EM>WHERE</EM> clause, fetch the topmost Op instance with
the <A HREF="#item_where"><CODE>where</CODE></A> method. Then evaluate the left-hand and right-hand side
of the operation, perhaps recursively. Once that is done, apply the
operator and finally negate the result, if required.</P>
</DL>
<P>To illustrate the above, consider the following WHERE clause:</P>
<PRE>
WHERE NOT (id > 2 AND name = 'joe') OR name IS NULL</PRE>
<P>We can represent this clause by the following tree:</P>
<PRE>
(id > 2) (name = 'joe')
\ /
NOT AND
\ (name IS NULL)
\ /
OR</PRE>
<P>Thus the WHERE clause would return an SQL::Statement::Op instance with
the <A HREF="#item_op"><CODE>op()</CODE></A> field set to 'OR'. The <A HREF="#item_arg2"><CODE>arg2()</CODE></A> field would return another
SQL::Statement::Op instance with <A HREF="#item_arg1"><CODE>arg1()</CODE></A> being the SQL::Statement::Column
instance representing id, the <A HREF="#item_arg2"><CODE>arg2()</CODE></A> field containing the value undef
(NULL) and the <A HREF="#item_op"><CODE>op()</CODE></A> field being 'IS'.</P>
<P>The <A HREF="#item_arg1"><CODE>arg1()</CODE></A> field of the topmost Op instance would return an Op instance
with <A HREF="#item_op"><CODE>op()</CODE></A> eq 'AND' and <A HREF="#item_neg"><CODE>neg()</CODE></A> returning TRUE. The <A HREF="#item_arg1"><CODE>arg1()</CODE></A> and <A HREF="#item_arg2"><CODE>arg2()</CODE></A>
fields would be Op's representing ``id > 2'' and ``name = 'joe'''.</P>
<P>Of course there's a ready-for-use method for WHERE clause evaluation:</P>
<P>
<H2><A NAME="evaluating a where clause">Evaluating a WHERE clause</A></H2>
<P>The WHERE clause evaluation depends on an object being used for
fetching parameter and column values. Usually this can be an
SQL::Eval object, but in fact it can be any object that supplies
the methods</P>
<PRE>
$val = $eval->param($paramNum);
$val = $eval->column($table, $column);</PRE>
<P>See <A HREF="../../../site/lib/SQL/Eval.html">the SQL::Eval manpage</A> for a detailed description of these methods.