RWDBCompoundSelector RWDBSelectorBase
#include <rw/db/comsel.h> RWDBSelector s1, s2; RWDBCompoundSelector cs = s1 + s2; RWDBCompoundSelector cs = s1 * s2 RWDBCompoundSelector cs = s1 - s2;
Instances of this class are created as the result of the set operators Union, Intersection, or Difference applied to RWDBSelector.
RWDBSelector and RWDBCompoundSelector share the common base class RWDBSelectorBase.
RWDBCompoundSelector(const RWDBCompoundSelector& csel);
Copy constructor. The created RWDBCompoundSelector shares an implementation with csel.
RWDBCompoundSelector& operator=(const RWDBCompoundSelector& csel);
Assignment operator. Self shares an implementation with csel. Returns a reference to self.
RWCString asString() const;
Inherited from RWDBSelectorBase. Returns the SQL equivalent of:
SELECT ... FROM ... WHERE (SELECT ...)
<operator> (SELECT ...)
RWDBDatabase database() const;
Inherited from RWDBSelectorBase. Returns the database which produced self.
RWDBCompoundSelector& difference(const RWDBSelectorBase& selector) const;
Inherited from RWDBSelectorBase. Returns an RWDBCompoundSelector which represents the SQL selector:
select-stmt DIFFERENCE selector
where select-stmt is the SELECT statement represented by self.
RWDBStatus::ErrorHandler errorHandler() const;
Returns the error handler attached to self.
RWDBResult execute();
Inherited from RWDBSelectorBase. Uses a default database connection to submit the SQL SELECT statement encapsulated by self for execution. There will always be one or more RWDBTables in the returned RWDBResult.
RWDBResult execute(const RWDBConnection& connection);
Inherited from RWDBSelectorBase. Uses the supplied connection to submit the SQL SELECT statement encapsulated by self for execution. There will always be one or more RWDBTables in the returned RWDBResult. This function can behave asynchronously if executed using an asynchronous connection.
RWDBCompoundSelector& intersection(const RWDBSelectorBase& selector) const;
Inherited from RWDBSelectorBase. Returns an RWDBCompoundSelector, which represents the SQL selector:
select-stmt INTERSECTION selector
where select-stmt is the SELECT statement represented by self.
RWBoolean isValid()const;
Inherited from RWDBSelectorBase. Returns TRUE if self's status is RWDBStatus::ok, otherwise returns FALSE.
RWDBSelectorBase& orderBy(const RWDBColumn& column);
Inherited from RWDBSelectorBase. Adds an ORDER BY column clause to the select statement represented by self. If self already has an ORDER BY clause, column is appended to the existing ORDER BY clause. Returns a reference to self.
RWDBSelectorBase& orderBy(int columnNumber);
Inherited from RWDBSelectorBase. Adds an ORDER BY columnNumber clause to the select statement represented by self. If self already has an ORDER BY clause, columnNumber is appended to the existing ORDER BY clause. Returns a reference to self.
RWDBSelectorBase& orderByClear();
Inherited from RWDBSelectorBase. Removes all ORDER BY clauses, if any, from self. Returns a reference to self.
RWDBSelectorBase& orderByDescending(const RWDBColumn& column);
Inherited from RWDBSelectorBase. Adds the clause ORDER BY column DESCENDING to the select statement represented by self. If self already has an ORDER BY clause, column is appended to the existing ORDER BY clause. Returns a reference to self.
RWDBSelectorBase& orderByDescending(int columnNumber);
Inherited from RWDBSelectorBase. Adds the clause ORDER BY columnNumber DESCENDING to the select statement represented by self. If self already has an ORDER BY clause, columnNumber is appended to the existing ORDER BY clause. Returns a reference to self.
RWDBReader reader() const;
Inherited from RWDBSelectorBase. An RWDBReader is produced, using a default connection to self's database(). This causes the SELECT statement represented by self to be executed in the database, with the resulting RWDBReader providing row-by-row access to the selected data. Equivalent to execute().table().reader(). This function can behave asynchronously if executed using an asynchronous connection.
RWDBReader reader(const RWDBConnection& connection) const;
Inherited from RWDBSelectorBase. An RWDBReader is produced, using the supplied connection to self's database(). This causes the SELECT statement represented by self to be executed in the database, with the resulting RWDBReader providing row-by-row access to the selected data. The function is equivalent to execute(connection).table().reader(). This function can behave asynchronously if executed using an asynchronous connection.
void setErrorHandler(RWDBStatus::ErrorHandler handler);
Inherited from RWDBSelectorBase. Installs handler as the error handler for self. The supplied handler is inherited by all objects produced by self. By default, an error handler is inherited from the object which produced the object; this method overrides the default. ErrorHandler is declared as a typedef within the scope of RWDBStatus:
typedef void (*ErrorHandler)(const RWDBStatus& status);
RWDBStatus status() const;
Inherited from RWDBSelectorBase. Returns the status of self.
virtual RWDBCompoundSelector& union_(const RWDBSelectorBase& selector) const;
Inherited from RWDBSelectorBase. Returns an RWDBCompoundSelector, which represents the SQL selector:
select-stmt UNION selector
where select-stmt is the SELECT statement represented by self. The trailing underscore is to avoid conflict with the C++ union keyword.
virtual RWDBCompoundSelector& unionAll(const RWDBSelectorBase& selector) const;
Inherited from RWDBSelectorBase. Returns an RWDBCompoundSelector which represents the SQL selector:
SELECT select-stmt UNION ALL
where select-stmt is the SELECT statement represented by self.
RWDBCompoundSelector operator+(const RWDBSelectorBase& left, const RWDBSelectorBase& right);
Union. Inherited from RWDBSelectorBase. Equivalent to left.union_(right).
RWDBCompoundSelector operator-(const RWDBSelectorBase& left, const RWDBSelectorBase& right);
Difference. Inherited from RWDBSelectorBase. Equivalent to left.difference(right).
RWDBCompoundSelector operator*(const RWDBSelectorBase& left, const RWDBSelectorBase& right);
Intersection. Inherited from RWDBSelectorBase. Equivalent to left.intersection(right).
©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.