Module: DB Interface Module Group: Database Classes
Does not inherit
#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, 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's 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 (so that an array of RWDBTables may be declared, for example). 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 (i.e., the returned RWDBColumn's table() method returns this table). If no matching column is found, returns a RWDBColumn whose status is RWDBStatus::OK. This is used with RWDBSelector to build up selections and criterion 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;
The function attempts to acquire the internal mutex lock. If the mutex is already locked, the function will block until the mutex is released. This function can be called from a const object.
RWDBStatus addColumn(const RWDBColumn& column);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be RWDBStatus::invalidUsage.
RWDBStatus addColumn(const RWDBColumn& column, const RWDBConnection& connection);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be 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, bool nullAllowed = true, RWDBColumn::ParamType paramType = RWDBColumn::notAParameter);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be 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, bool nullAllowed = true, RWDBColumn::ParamType paramType = RWDBColumn::notAParameter);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be 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, according to caseCompare, 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 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, bool unique = true, bool clustered = true);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be RWDBStatus::invalidUsage.
RWDBStatus createIndex(const RWCString& name, const RWDBSchema& columns, const RWDBConnection& connection, bool unique = true, bool clustered = true);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be 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, 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, produces an RWDBCursor whose status is 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 (e.g., if this table was created using the default constructor), 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();
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
Uses a default database connection to drop the database table or view represented by self. Send 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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table or view, the returned status will be RWDBStatus::invalidUsage.
RWDBStatus drop(const RWDBConnection& connection);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
Uses the supplied connection to drop the database table or view represented by self. Send 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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table or view, the returned status will be RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus dropColumn(const RWDBColumn& column);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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 column name of the given column. If successful, calls fetchSchema() so that self's schema remains consistent with the database. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be RWDBStatus::invalidUsage.
RWDBStatus dropColumn(const RWDBColumn& column, const RWDBConnection& connection);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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 column name of the given column. If successful, calls fetchSchema() so that self's schema remains consistent with the database. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus dropIndex(const RWCString& name);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be RWDBStatus::invalidUsage.
RWDBStatus dropIndex(const RWCString& name, const RWDBConnection& connection);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. Check the returned value's isValid() method to determine whether the operation succeeded. If self is not a database table, the returned status will be RWDBStatus::invalidUsage. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus::ErrorHandler errorHandler() const;
Returns the error handler attached to self.
bool exists(bool forceLookup = false);
If self is a database table, returns true if the table exists in the database, false otherwise. 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, false otherwise.
To determine whether or not a database table exists, SourcePro Core 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.
bool exists(const RWDBConnection& connection, bool forceLookup = false);
If self is a database table, returns true if the table exists in the database, false otherwise. 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, false otherwise.
To determine whether or not a database table exists, SourcePro Core 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 bool fetchSchema();
If self is a database table, returns true if schema information about the table can be obtained, false otherwise. 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, false otherwise.
To obtain schema information, SourcePro Core 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 bool fetchSchema(const RWDBConnection& connection);
If self is a database table, returns true if the schema information about the table can be obtained, false otherwise. 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, false otherwise.
To obtain schema information, SourcePro Core 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);
Use conn to append a list of foreign keys to keyList. If refName is blank, keyList contains all self's foreign keys. If refName is not blank, keyList contains the foreign key of self which refers to refName. An empty list indicates there are no foreign keys associated with self referring to refName. Check the returned value's isValid() method to determine whether the operation succeeded.
RWDBStatus foreignKeys(const RWCString& refName, RWDBForeignKeyList& keyList);
Use the default connection to append a list of foreign keys to keyList. If refName is blank, keyList contains all self's foreign keys. If refName is not blank, keyList contains the foreign key of self which refers to refName. An empty list indicates there are no foreign keys associated with self referring to refName. Check the returned value's isValid() method to determine whether the operation succeeded.
RWDBStatus grant(const RWCString& privilege, const RWCString& user);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned status will be RWDBStatus::noPrivilege.
RWDBStatus grant(const RWCString& privilege, const RWDBSchema& columnList, const RWCString& user);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned object will be RWDBStatus::noPrivilege.
RWDBStatus grant(const RWCString& privilege, const RWCString& user, const RWDBConnection& connection);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned object will be 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);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned object's isValid() method to see if the operation succeeded. If self is not a database table, the returned object will be 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, according to caseCompare, the given name. Returns RW_NPOS if there is no such column.
RWDBInserter inserter() const;
Produces an RWDBInserter which encapsulates the SQL statement:
INSERT INTO <table> VALUES
where <table> is represented by self. The actual values must be added to the inserter later. This method is equivalent to database.inserter(*this). If self is not a database table, returns an RWDBInserter with a status of RWDBStatus::noInserter.
RWDBInserter inserter(const RWDBSchema& columnList) const;
Produces an RWDBInserter which 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. This method is equivalent to database.inserter(*this, columnList). If self is not a database table, returns an RWDBInserter with a status of RWDBStatus::noInserter.
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 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 RWDBCompoundSelector& 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.
bool isReady() const;
This function returns true if the object is in ready state, indicating that accessing the object will not block. Accessing a non-ready object may potentially block.
bool isValid() const;
Returns true if the status of self is RWDBStatus::ok, false otherwise.
bool isView() const;
Returns true if self represents a database view, otherwise 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.
bool isView(const RWDBConnection& connection) const;
Returns true if self represents a database view, otherwise 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 returned 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 returned value.
RWDBReader reader() 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.
RWDBReader reader(const RWDBConnection& connection) 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 a reader for the contents of the table. The reader holds the connection until the reader is destroyed. This function can behave asynchronously if executed using an asynchronous connection.
RWDBStatus referredToBy(RWDBForeignKeyList& keyList);
Uses the default connection to append to keyList all foreign keys that refer to self. Checks the returned 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. Checks the returned value's isValid() method to determine whether the operation succeeded.
void release() const;
This function releases a previously acquired mutex. This function can be called from a const object.
RWDBStatus revoke(const RWCString& privilege, const RWCString& user);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object will be RWDBStatus::noPrivilege.
RWDBStatus revoke(const RWCString& privilege, const RWDBSchema& columnList, const RWCString& user);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object will be RWDBStatus::noPrivilege.
RWDBStatus revoke(const RWCString& privilege, const RWCString& user, const RWDBConnection& connection);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object will be 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);
When used in an XA-environment, this call may generate a server error. This method can still be used before XA connectivity is established.
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. SourcePro Core does not validate the supplied arguments. Check the returned value's isValid() method to see if the operation succeeded. If self is not a database table, the returned object will be 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 -- Database tables will not return valid column and schema information until fetchSchema() is called.
void setErrorHandler(RWDBStatus::errorHandler errorHandler);
Installs error handler as self's error handler. The supplied handler is inherited by all objects produced by self. By default an RWDBTable 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 SourcePro Core 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 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.