rwlogo
SourcePro 11.1

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWDBCriterion Class Reference
[Expressions]

Represents the result of applying logical operators to RWDBExpr. It is used to encapsulate SQL WHERE clauses. More...

#include <rw/db/expr.h>

Inheritance diagram for RWDBCriterion:
RWDBExpr

List of all members.

Public Member Functions

 RWDBCriterion (void)
 RWDBCriterion (const RWDBExpr &Left, RWDBPhraseBook::RWDBPhraseKey op, const RWDBExpr &Right)
 RWDBCriterion (RWDBPhraseBook::RWDBPhraseKey op, const RWDBExpr &expr)

Detailed Description

RWDBCriterion is the result of applying logical operators to RWDBExpr. It is used to encapsulate SQL WHERE clauses.

RWDBCriterion represents a specialized type of RWDBExpr that is evaluated in an SQL statement as a boolean value. RWDBCriterion adds neither components nor member functions to the base class. Instead, it ensures that a nonboolean expression is not placed in a context that requires a boolean expression during compilation.

Synopsis

 #include <rw/db/expr.h>

Related Classes

RWDBCriterion is a special case of RWDBExpr. Please see RWDBExpr for details about RWDBCriterion usage, including operators and constructors.

Examples

In this example, an RWDBCriterion is created anonymously to be used as part of an SQL WHERE clause:

 int x = somevalue;
 RWDBSelector select = myDbase.selector();
 select.where(myTable["myColumn"] != x);

Constructor & Destructor Documentation

RWDBCriterion::RWDBCriterion ( void   ) 

The default constructor creates an empty criterion.

RWDBCriterion::RWDBCriterion ( const RWDBExpr Left,
RWDBPhraseBook::RWDBPhraseKey  op,
const RWDBExpr Right 
)

Creates a dyadic RWDBCriterion from the Left and Right operands connected by the logical operator op.

RWDBCriterion::RWDBCriterion ( RWDBPhraseBook::RWDBPhraseKey  op,
const RWDBExpr expr 
)

Creates a monadic RWDBCriterion from the given op and expr.


© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.