#include <rw/db/table.h> RWDBTable myTable = myDbase.table("tableName"); RWDBTable myMemTable = myDbase.memTable("tableName"); RWDBResult myResult = mySelecter.execute(); //or deleter.execute() or updater.execute() or inserter.execute() or //storedProc.execute() RWDBTable myResultTable = myResult.table();
RWDBTable is a base class from which a family of classes derive. RWDBTable represents a table of information whose actual location is transparent. The data may reside in a database table or in program memory, or may be an SQL table expression, that is, a collection of rows returned from a database query. The three kinds of tables to which RWDBTable provides an interface are:
Database table-a handle to a table physically stored in the database
Result table-the rows returned as the result of a query
Memory table-a table stored in program memory
RWDBTable is designed around the Interface/Implementation paradigm. An RWDBTable instance is an interface to a reference-counted implementation; copy constructors and assignment operators produce additional references to a shared implementation. An RWDBTable implementation is a base class from which a family of table implementations is derived. Each implementation except that of RWDBMemTable is in turn a base class from which a family of database-specific table implementations derive.
RWDBTable();
The default constructor creates an RWDBTable whose status is RWDBStatus::notInitialized. This constructor is provided as a convenience, for example, for declaring an array of RWDBTables. Usable RWDBTables are obtained from RWDBDatabase and RWDBResult.
RWDBTable(const RWDBTable& table);
Copy constructor. Self shares an implementation with table.
RWDBTable& operator=(const RWDBTable& table);
Assignment operator. Self shares an implementation with table.
RWDBColumn operator[](const RWCString& name) const;
Returns a deep copy of the first RWDBColumn in self's schema whose name matches the given name. The RWDBColumn returned is associated with self, that is, the table() method of the returned RWDBColumn returns this table. If no matching column is found, returns an RWDBColumn whose status is RWDBStatus::ok. This is used with RWDBSelector to build up selectors and criterions without requiring an application to fetch the schema of a table. For example:
myselector << table["name"]
See also RWDBSelector.
RWDBColumn operator[](size_t position) const;
Returns a deep copy of the RWDBColumn in self's schema at the given position. The RWDBColumn returned is associated with self. If no matching is found, returns an RWDBColumn whose status is RWDBStatus::ColumnNotFound. A deep copy is made so that the application can modify the returned RWDBColumn without modifying self's schema.
void acquire() const;
Attempts to acquire the internal mutex lock. If the mutex is already locked by another thread, the function blocks until the mutex is released. This function can be called from a const object. Note: in nonmultithreaded builds, this function evaluates to a no-op.
RWDBStatus addColumn(const RWDBColumn& column);
Uses a default database connection to execute the database-specific equivalent of the SQL statement:
ALTER TABLE <table> ADD COLUMN <column>,
where <table> is the database table represented by self, and <column> is defined by the given column. If successful, calls fetchSchema() so that self's schema remains consistent with the database. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage.
RWDBStatus addColumn(const RWDBColumn& column, const RWDBConnection& connection);
Uses the supplied connection to execute the database-specific equivalent of the SQL statement:
ALTER TABLE <table> ADD COLUMN <column>
where <table> is the database table represented by self, and <column> is defined by the given column. If successful, calls fetchSchema() so that self's schema remains consistent with the database. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus addColumn(const RWCString& name, RWDBValue::ValueType type = RWDBValue::NoType, long storageLength = 0, int nativeType = -1, int precision = -1, int scale = -1, RWBoolean nullAllowed = TRUE, RWDBColumn::ParamType paramType = RWDBColumn::notAParameter);
Uses a default database connection to execute the database-specific equivalent of the SQL statement:
ALTER TABLE <table> ADD COLUMN <column>
where <table> is the database table represented by self, and <column> is defined by the supplied arguments. If successful, calls fetchSchema() so that self's schema remains consistent with the database. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage.
RWDBStatus addColumn(const RWCString& name, const RWDBConnection& connection, RWDBValue::ValueType type = RWDBValue::NoType, long storageLength = 0, int nativeType = -1, int precision = -1, int scale = -1, RWBoolean nullAllowed = TRUE, RWDBColumn::ParamType paramType = RWDBColumn::notAParameter);
Uses the supplied connection to execute the database-specific equivalent of the SQL statement:
ALTER TABLE <table> ADD COLUMN <column>
where <table> is the database table represented by self, and <column> is defined by the supplied arguments. If successful, calls fetchSchema() so that self's schema remains consistent with the database. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBBulkInserter bulkInserter(const RWDBConnection& conn);
Returns an RWDBBulkInserter able to insert values into self. The RWDBBulkInserter executes using the supplied connection.
RWDBBulkReader bulkReader(const RWDBConnection& conn);
Returns an RWDBBulkReader able to read the result set associated with the rows of self. The RWDBBulkReader executes using the supplied connection.
RWDBColumn column(const RWCString& name) const;
Returns a deep copy of the first RWDBColumn in self's schema whose name matches the given name. The RWDBColumn returned is associated with self, that is, the table() method of the returned RWDBColumn returns this table. If no matching column is found, returns an RWDBColumn whose status is RWDBStatus::columnNotFound. A deep copy is made so that applications can modify the returned RWDBColumn without modifying the associated RWDBTable schema.
NOTE:Database tables will not return valid column and schema information until fetchSchema() is called.
RWDBColumn column(const RWCString& name, RWCString::caseCompare caseCompare) const;
Returns a deep copy of the first RWDBColumn in self's schema whose name matches the given name, according to caseCompare. The RWDBColumn returned is associated with self, that is, the table() method of the returned RWDBColumn returns this table. If no matching column is found, returns an RWDBColumn whose status is RWDBStatus::columnNotFound. A deep copy is made so that applications can modify the returned RWDBColumn without modifying self's schema. A deep copy of the column from self at the specified index is made.
NOTE:Database tables will not return valid column and schema information until fetchSchema() is called.
RWDBColumn column(size_t index) const;
Returns a deep copy of the RWDBColumn in self's schema at the given index. The RWDBColumn returned is associated with self, that is, the table() method of the returned RWDBColumn returns this table. A deep copy is made so that applications can modify the returned RWDBColumn without modifying the associated RWDBTable schema. If index is out of range, returns an RWDBColumn whose status is RWDBStatus::columnNotFound.
NOTE:Database tables will not return valid column and schema information until fetchSchema() is called.
RWDBStatus createIndex(const RWCString& name, const RWDBSchema& columns, RWBoolean unique = TRUE, RWBoolean clustered = TRUE);
Uses a default connection to send the database-specific equivalent of the SQL statement:
CREATE [unique] [clustered] INDEX name
ON <table> (<columns>)
where name is the name of the index to be created, <table> is the database table represented by self, <columns> is a list of columns defined by columns, and the optional keywords unique and clustered are present or absent according to the supplied values unique and clustered. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage.
RWDBStatus createIndex(const RWCString& name, const RWDBSchema& columns, const RWDBConnection& connection, RWBoolean unique = TRUE, RWBoolean clustered = TRUE);
Uses the supplied connection to send the database-specific equivalent of the SQL statement
CREATE [unique] [clustered] INDEX name
ON <table> (<columns>)
where name is the name of the index to be created, <table> is the database table represented by self, <columns> is a list of columns defined by columns, and the optional keywords unique and clustered are present or absent according to the supplied values unique and clustered. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBCursor cursor(RWDBCursor::CursorType = RWDBCursor::Sequential, RWDBCursor::CursorAccess = RWDBCursor::Read) const;
If self is a database table, produces an RWDBCursor for execution of the SQL statement:
SELECT * from <table>
where <table> is the database table represented by self. The cursor is created on a default database connection, using the type and access specifications provided. The connection is held by the RWDBCursor until the RWDBCursor is destroyed. If self is a result table or a memory table, the function produces an RWDBCursor whose status is RWDBStatus::noCursor.
RWDBCursor cursor(const RWDBConnection& connection, RWDBCursor::CursorType = RWDBCursor::Sequential, RWDBCursor::CursorAccess = RWDBCursor::Read) const;
If self is a database table, produces an RWDBCursor for execution of the SQL statement:
SELECT * from <table>
where <table> is the database table represented by self. The cursor is created on the supplied database connection, using the type and access specifications provided. The connection is held by the RWDBCursor until the RWDBCursor is destroyed. If self is a result table or a memory table, the function produces an RWDBCursor with status RWDBStatus::noCursor. This function can behave asynchronously if executed using an asynchronous connection.
RWDBCursor cursor(const RWDBSchema& updateCols, RWDBCursor::CursorType type = RWDBCursor::Sequential, RWDBCursor::CursorAccess access = RWDBCursor::Read) const;
Produces an RWDBCursor for execution of the SQL statement:
SELECT * from <table>
where <table> is the database table represented by self. The argument updateCols is used in building a clause:
FOR UPDATE OF column-name, column-name,...
Some SQL dialects require this form. The cursor is created on a default database connection, using the type and access specifications provided. The connection is held by the RWDBCursor until the RWDBCursor is destroyed.
RWDBCursor cursor(const RWDBSchema& updateCols, const RWDBConnection& connection, RWDBCursor::CursorType type = RWDBCursor::Sequential, RWDBCursor::CursorAccess access = RWDBCursor::Read) const;
Produces an RWDBCursor for execution of the SQL statement:
SELECT * from <table>
where <table> is the database table represented by self. The cursor is created on the supplied database connection, using the type and access specifications provided. The connection is held by the RWDBCursor until the RWDBCursor is destroyed. Some SQL dialects require this form. The argument updateCols is used in building a clause:
FOR UPDATE OF column-name, column-name,...
This function can behave asynchronously if executed using an asynchronous connection.
RWDBDatabase database() const;
Returns the RWDBDatabase that produced this table. If there is no such object, for example, if this table was created using the default constructor, the function returns an RWDBDatabase with a status of RWDBStatus::notInitialized.
RWDBDeleter deleter() const;
Produces an RWDBDeleter that can be used to delete all rows from self. The result is an encapsulation of the SQL statement:
DELETE FROM <table>
where <table> is self's table name. If self is not a database table, returns an RWDBDeleter whose status is RWDBStatus::noDeleter.
RWDBDeleter deleter(const RWDBCriterion& criterion)const;
Produces an RWDBDeleter that can be used to delete rows from self based on criterion. An RWDBCriterion is an encapsulated SQL WHERE clause. The result is an encapsulation of the SQL statement:
DELETE FROM <table> WHERE criterion
where <table> is self's table name. If self is not a database table, returns an RWDBDeleter whose status is RWDBStatus::noDeleter.
RWDBStatus drop();
Uses a default database connection to drop the database table or view represented by self. Sends the database-specific equivalent of either the SQL statement:
DROP TABLE <table>
where <table> is the database table represented by self, or:
DROP VIEW <view>
where <view> is the database view represented by self. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table or view, the returned status is RWDBStatus::invalidUsage.
RWDBStatus drop(const RWDBConnection& connection);
Uses the supplied connection to drop the database table or view represented by self. Sends the database-specific equivalent of either the SQL statement:
DROP TABLE <table>,
where <table> is the database table represented by self, or:
DROP VIEW <view>
where <view> is the database view represented by self. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table or view, the returned status is RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus dropColumn(const RWDBColumn& column);
Uses a default database connection to execute the database-specific equivalent of the SQL:
ALTER TABLE <table> DROP COLUMN <column>
where <table> is the database table represented by self, and <column> is the column name of the given column. If successful, calls fetchSchema() so that self's schema remains consistent with the database. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage.
RWDBStatus dropColumn(const RWDBColumn& column, const RWDBConnection& connection);
Uses the supplied connection to execute the database-specific equivalent of the SQL:
ALTER TABLE <table> DROP COLUMN <column>
where <table> is the database table represented by self, and <column> is the column name of the given column. If successful, calls fetchSchema() so that self's schema remains consistent with the database. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus dropIndex(const RWCString& name);
Uses a default database connection to send the database-specific equivalent of the SQL:
DROP INDEX <table>.name
where <table> is the database table represented by self, and name is the name of the index to be dropped. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage.
RWDBStatus dropIndex(const RWCString& name, const RWDBConnection& connection);
Uses the supplied connection to send the database-specific equivalent of the SQL:
DROP INDEX <table>.name
where <table> is the database table represented by self, and name is the name of the index to be dropped. You can check the return value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status is RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus::ErrorHandler errorHandler() const;
Returns the error handler attached to self.
RWBoolean exists(RWBoolean forceLookup = FALSE);
If self is a database table, returns TRUE if the table exists in the database, otherwise returns FALSE. If self is a memory table, always returns TRUE. If self is a result table, returns TRUE if an RWDBReader has not yet been obtained to read self, otherwise returns FALSE.
To determine whether or not a database table exists, DBTools.h++ uses a default connection to query the database for the table's schema. If no schema can be obtained, FALSE is returned. Otherwise, self's RWDBSchema is populated with the result of the query and TRUE is returned. By default, multiple calls to a database table's exists() method always return the same result; the database is only queried on the first call. This behavior can be overridden by forceLookup, which, if TRUE, forces the database to be queried.
RWBoolean exists(const RWDBConnection& connection, RWBoolean forceLookup = FALSE);
If self is a database table, returns TRUE if the table exists in the database, otherwise returns FALSE. If self is a memory table, always returns TRUE. If self is a result table, returns TRUE if an RWDBReader has not yet been obtained to read self, otherwise returns FALSE.
To determine whether or not a database table exists, DBTools.h++ uses the supplied connection to query the database for the table's schema. If no schema can be obtained, FALSE is returned. Otherwise, self's RWDBSchema is populated with the result of the query and TRUE is returned. By default, multiple calls to a database table's exists() method always return the same result; the database is only queried on the first call. This behavior can be overridden by forceLookup, which, if TRUE, forces the database to be queried.
virtual RWBoolean fetchSchema();
If self is a database table, returns TRUE if schema information about the table can be obtained, otherwise returns FALSE . If self is a memory table, always returns TRUE. If self is a result table, returns TRUE if an RWDBReader has not yet been obtained to read self, otherwise returns FALSE .
To obtain schema information, DBTools.h++ uses a default database connection to query the database. If no schema can be obtained, FALSE is returned. Otherwise, self's RWDBSchema is populated with the result of the query and TRUE is returned
virtual RWBoolean fetchSchema(const RWDBConnection& connection);
If self is a database table, returns TRUE if the schema information about the table can be obtained, otherwise returns FALSE. If self is a memory table, always returns TRUE. If self is a result table, returns TRUE if an RWDBReader has not yet been obtained to read self, otherwise returns FALSE.
To obtain schema information, DBTools.h++ uses the supplied connection to query the database. If no schema can be obtained, FALSE is returned. Otherwise, self's RWDBSchema is populated with the result of the query and TRUE is returned.
RWDBStatus foreignKeys(const RWDBConnection& conn, const RWCString& refName, RWDBForeignKeyList& keyList);
Uses conn to append a list of foreign keys to keyList. If refName is blank, keyList will contain all self's foreign keys. If refName is not blank, keyList will contain the foreign key of self that refers to refName. An empty list indicates there are no foreign keys associated with self referring to refName. You can check the return value's isValid() method to determine whether the operation succeeded.
RWDBStatus foreignKeys(const RWCString& refName, RWDBForeignKeyList& keyList);
Uses the default connection to append a list of foreign keys to keyList. If refName is blank, keyList will contain all self's foreign keys. If refName is not blank, keyList will contain the foreign key of self that refers to refName. An empty list indicates there are no foreign keys associated with self referring to refName. You can check the return value's isValid() method to determine whether the operation succeeded.
RWDBStatus grant(const RWCString& privilege, const RWCString& user);
Uses a default database connection to execute the database-specific equivalent of the SQL:
GRANT privilege ON <table> TO user
where <table> is self's table name. DBTools.h++ does not validate the supplied arguments. You can check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned status is RWDBStatus::noPrivilege.
RWDBStatus grant(const RWCString& privilege, const RWDBSchema& columnList, const RWCString& user);
Uses a default database connection to execute the database-specific equivalent of the SQL:
GRANT privilege ON <table> (<column-list>) TO user
where <table> is self's table name, and <column-list> is a list of column names from self's schema. DBTools.h++ does not validate the supplied arguments. You can check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned object is RWDBStatus::noPrivilege.
RWDBStatus grant(const RWCString& privilege, const RWCString& user, const RWDBConnection& connection);
Uses the supplied database connection to execute the database-specific equivalent of the SQL:
GRANT privilege ON <table> TO user
where <table> is self's table name. DBTools.h++ does not validate the supplied arguments. You can check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned object is RWDBStatus::noPrivilege. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus grant(const RWCString& privilege, const RWDBSchema& columnList, const RWCString& user, const RWDBConnection& connection);
Uses the supplied database connection to execute the database-specific equivalent of the SQL:
GRANT privilege ON <table> (<column-list>) TO user
where <table> is self's table name, and <column-list> is a list of column names from self's schema. DBTools.h++ does not validate the supplied arguments. You can check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned object is RWDBStatus::noPrivilege. This function can behave asynchronously if executed using an asynchronous connection.
size_t index(const RWCString& name) const;
Returns the index in self's schema of the first column with the given name. Returns RW_NPOS if there is no such column.
size_t index(const RWDBColumn& column) const;
Returns the index in self's schema of the first column whose name matches the name of the given column. Returns RW_NPOS if there is no such column.
size_t index(const RWCString& name, RWCString::caseCompare caseCompare) const;
Returns the index in self's schema of the first column which matches the given name, according to caseCompare. Returns RW_NPOS if there is no such column.
RWDBInserter inserter(size_t cache=1) const;
Produces an RWDBInserter that encapsulates the SQL statement:
INSERT INTO <table> VALUES
where <table> is represented by self. The actual values must be added to the inserter later. If self is not a database table, returns an RWDBInserter with a status of RWDBStatus::noInserter.
NOTE:A cache of 0 is not allowed. If 0 is passed in for this parameter, the parameter is set to 1. Setting the cache parameter greater than one can adversely affect transactions. Check your access library documentation for limitations and warnings.
RWDBInserter inserter(const RWDBSchema& columnList) const;
Produces an RWDBInserter that encapsulates the SQL statement:
INSERT INTO <table> (col1, ..., coln)
VALUES(val1, ..., valn)
where <table> is represented by self. The names of the column entries in columnList are used to build up the column-name list. If self is not a database table, returns an RWDBInserter with a status of RWDBStatus::noInserter.
NOTE:A cache of 0 is not allowed. If 0 is passed in for this parameter, the parameter is set to 1. Setting the cache parameter greater than one can adversely affect transactions. Check your access library documentation for limitations and warnings.
RWDBInserter inserter(const RWDBSelector& select) const;
Produces an RWDBInserter which encapsulates the SQL statement:
INSERT INTO <table> select-statement
where <table> is represented by self. The select-statement is encapsulated by the given select. This method is equivalent to database.inserter(*this, select). If self is not a database table, returns an RWDBInserter with a status of RWDBStatus::noInserter.
RWDBInserter inserter(const RWDBSelector& select, const RWDBSchema& columnList) const;
Produces an RWDBInserter which encapsulates the SQL statement:
INSERT INTO <table> ( col1, ..., coln) select-statement
where <table> is represented by self. The names of the column entries in columnList are used to build up the column-name list. The select-statement is encapsulated by the given select. This method is equivalent to database.inserter(*this, select, columnList). If self is not a database table, returns an RWDBInserter with a status of RWDBStatus:noInserter.
RWDBInserter inserter(const RWDBCompoundSelector& select) const;
Produces an RWDBInserter that encapsulates the SQL statement:
INSERT INTO <table> select-statement
where <table> is represented by self. The select-statement is encapsulated by the given select. This method is equivalent to database.inserter(*this, select). If self is not a database table, returns an RWDBInserter with a status of RWDBStatus:noInserter.
RWDBInserter inserter(const RWDBCompoundSelector& select, const RWDBSchema& columnList) const;
Produces an RWDBInserter that encapsulates the SQL statement:
INSERT INTO <table> (col1,..., cold) select-statement
where <table> is represented by self. The names of the column entries in columnList are used to build up the column-name list. The select-statement is encapsulated by the given select. This method is equivalent to database.inserter(*this, select, columnList). If self is not a database table, returns an RWDBInserter with a status of RWDBStatus::noInserter.
RWBoolean isReady() const;
This function returns TRUE if the object is in ready state, indicating that accessing the object will not block. Accessing a nonready object may potentially block.
RWBoolean isValid() const;
Returns TRUE if the status of self is RWDBStatus::ok, otherwise returns FALSE.
RWBoolean isView() const;
Returns TRUE if self represents a database view, otherwise returns FALSE. More specifically, if self is not a database table, returns FALSE; otherwise calls exists(), and returns FALSE if exists() returns FALSE; otherwise returns TRUE if self is a database view; otherwise returns FALSE.
RWBoolean isView(const RWDBConnection& connection) const;
Returns TRUE if self represents a database view, otherwise returns FALSE. More specifically, if self is not a database table returns FALSE; otherwise calls exists(conn), and returns FALSE if exists(conn) returns FALSE; otherwise returns TRUE if self is a database view; otherwise returns FALSE.
RWCString name() const;
Returns self's name. Returns an empty string if self is unnamed.
RWDBTable& name(RWCString& name);
Changes the name of self to name. Returns a reference to self.
size_t numberOfColumns() const;
Returns the number of columns in a self's schema.
RWDBSchema primaryKey();
Uses the default connection to fetch the primary key associated with self. Returns the primary key as an RWDBSchema. Updates self's schema with the return value.
RWDBSchema primaryKey(const RWDBConnection& conn);
Uses conn to fetch the primary key associated with self. Returns the primary key as an RWDBSchema. Updates self's schema with the return value.
RWDBReader reader(size_t cache=0) const;
Produces an RWDBReader which can be used to read data from self one row at a time. Unless self is a memory table, a query is executed using a default database connection, returning a reader for the contents of the table. The reader holds the connection until the reader is destroyed.
NOTE:When cache is 0, an acceptable default is selected by your access library. Please check your access library documentation for limitations on the cache size.
RWDBReader reader(const RWDBConnection& connection, size_t cache=0) const;
Produces an RWDBReader which can be used to read data from self one row at a time. Unless self is a memory table, a query is executed using the supplied connection, returning an RWDBReader for the contents of the table. The RWDBReader holds the connection until the RWDBReader is destroyed. This function can behave asynchronously if executed using an asynchronous connection.
NOTE:When cache is 0, an acceptable default is selected by your access library. Please check your access library documentation for limitations on the cache size.
RWDBStatus referredToBy(RWDBForeignKeyList& keyList);
Uses the default connection to append to keyList all foreign keys that refer to self. You can check the return value's isValid() method to determine whether the operation succeeded.
RWDBStatus referredToBy(const RWDBConnection& conn, RWDBForeignKeyList& keyList );
Uses conn to append to keyList all foreign keys which refer to self. You can check the return value's isValid() method to determine whether the operation succeeded.
void release() const;
Releases a previously acquired mutex. This function can be called from a const object. Note: in nonmultithreaded builds, this function evaluates to a no-op.
RWDBStatus revoke(const RWCString& privilege, const RWCString& user);
Uses a default database connection to execute the database-specific equivalent of the SQL statement:
REVOKE privilege ON <table> FROM user
where <table> is self's table name. DBTools.h++ does not validate the supplied arguments. You can check the return value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object is RWDBStatus::noPrivilege.
RWDBStatus revoke(const RWCString& privilege, const RWDBSchema& columnList, const RWCString& user);
Uses a default database connection to execute the database-specific equivalent of the SQL:
REVOKE privilege ON <table> (<column-list>) FROM user
where <table> is self's table name, and <column-list> is a list of column names from self's schema. DBTools.h++ does not validate the supplied arguments. You can check the return value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object is RWDBStatus::noPrivilege.
RWDBStatus revoke(const RWCString& privilege, const RWCString& user, const RWDBConnection& connection);
Uses the supplied database connection to execute the database-specific equivalent of the SQL:
REVOKE privilege ON <table> FROM user
where <table> is self's table name. DBTools.h++ does not validate the supplied arguments. You can check the return value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object is RWDBStatus::noPrivilege. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus revoke(const RWCString& privilege, const RWDBSchema& columnList, const RWCString& user, const RWDBConnection& connection);
Uses the supplied database connection to execute the database-specific equivalent of the SQL:
REVOKE privilege ON <table> (<column-list>) FROM user
where <table> is self's table name, and <column-list> is a list of column names from self's schema. DBTools.h++ does not validate the supplied arguments. You can check the return value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object is RWDBStatus::noPrivilege. This function can behave asynchronously if executed using an asynchronous connection.
RWDBSchema schema() const;
Returns a deep copy of self's RWDBSchema. The copy is made so that an application can modify the returned RWDBSchema without changing the schema of the associated RWDBTable.
NOTE:Datebase tables will not return valid column and schema information until fetchSchema() is called.
void setErrorHandler(RWDBStatus::errorHandler errorHandler);
Installs errorHandler as self's error handler. The supplied handler is inherited by all objects produced by self. By default an RWDBConnection error handler is inherited from the object that produced it. This method overwrites the default.
RWDBStatus status() const;
Returns the status of self.
RWCString tag() const;
Returns self's tag. A table's tag is an alias generated by DBTools.h++ for use in SQL queries.
RWDBTable& tag(const RWCString newTag);
Set self's tag to newTag. Returns reference to self.
RWDBUpdater updater() const;
Produces an RWDBUpdater. The result can be augmented with one or more RWDBAssignments in order to create an encapsulated SQL UPDATE statement to update all rows in self. If self is not a database table, returns an RWDBUpdater whose status is RWDBStatus::noUpdater.
RWDBUpdater updater(const RWDBCriterion& criterion) const;
Produces an RWDBUpdater. The result can be augmented with one or more RWDBAssignments in order to create an encapsulated SQL UPDATE statement to update rows in self specified by criterion. If self is not a database table, returns an RWDBUpdater whose status is RWDBStatus::noUpdater.
©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.