Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Table class. More...
#include <ilviews/dataccess/sqltable.h>
Public Member Functions | |
IliSQLTable (IlvDisplay *display) | |
This constructor initializes an SQL table. More... | |
IliSQLTable (const IliSQLTable &) | |
This is the copy constructor of the IliSQLTable class. | |
IliSQLTable (IlvDisplay *, IL_STDPREF istream &input) | |
This constructor initializes an SQL table by reading its definition from an input stream. More... | |
IlInt | addJoin (IlInt tblNo1, const IliAttributePath &colName1, IlInt tblNo2, const IliAttributePath &colName2) |
Adds a join. More... | |
IlInt | addJoin (IlInt tblNo1, const char *colName1, IlInt tblNo2, const char *colName2) |
Adds a join. More... | |
IlInt | addTable (const IliSQLTableRef &tblRef) |
Adds a table reference to the "from" clause of the query. More... | |
IlInt | addTableColumn (const IliSQLTableDef *tblDef, IlInt tblno, IlInt colno) |
Appends a new column. More... | |
virtual IlBoolean | allowColumnMove () const |
Returns IlTrue if columns can be moved to this schema. More... | |
virtual IlBoolean | applyQueryMode (IliTable *queryTable) |
Applies the query specified by the conditions contained in the provided table. More... | |
IlBoolean | cancelAsyncCall () |
Cancels all the asynchronous calls that are not completed. More... | |
virtual void | clearRows () |
Deletes all rows. More... | |
IlBoolean | continueAsyncCall () |
If there is an asynchronous call in progress, this member function again calls the asynchronous-enabled member function that is not completed. More... | |
void | deleteConjunct (IlInt cno, IlBoolean wherePart) |
Deletes a conjunct. More... | |
void | deleteJoin (IlInt jno) |
Deletes a join. More... | |
virtual IlBoolean | deleteRow (IlInt r) |
Deletes a row. More... | |
void | enableNoWaitOnLockRow (IlBoolean nowait) |
Specifies whether "waiting on row locking" is enabled. More... | |
virtual IlBoolean | exchangeRows (IlInt rowno1, IlInt rowno2) |
Exchanges two rows. More... | |
virtual IlInt | fetchAll () |
Fetches all remaining rows and stores them in the local row cache. More... | |
virtual IlBoolean | fetchCompleted () const |
Returns IlTrue , if all the rows have been fetched from the database and stored in the local row cache. More... | |
virtual IlInt | fetchNext (IlInt cnt=1) |
Fetches up a number of rows from the database and stores them in the local row cache. More... | |
IlInt | findJoin (IlInt tblNo1, const IliAttributePath &colName1, IlInt tblNo2, const IliAttributePath &colName2) const |
Returns the position of the join which corresponds to the definition. More... | |
IlBoolean | getAutoCommit () const |
Returns IlTrue if the SQL table is in auto-commit mode. More... | |
IlBoolean | getAutoRefresh () const |
Returns IlTrue if the SQL table is in auto-refresh mode. More... | |
IliTable * | getCache () const |
Returns the IliTable that manages the local row cache. More... | |
const IliSQLCatalog & | getCatalog () const |
Returns the catalog of the SQL table. More... | |
IliSQLCatalog & | getCatalog () |
Returns the catalog of the SQL table. More... | |
IlInt | getColumnDesignWidth (IlInt colno) const |
Returns the design width, in pixels, of the column. More... | |
IliSQLOperation | getColumnOperation (IlInt colno) const |
Returns the operation requested for the column. More... | |
IliSQLOrderByType | getColumnOrderBy (IlInt colno) const |
Returns the order requested for the column. More... | |
const char * | getColumnPredicat (IlInt colno, IlInt cno, IlBoolean wherePart) const |
Returns the predicate for the column in the conjunct. More... | |
const char * | getColumnSQLText (IlInt colno) const |
Returns the text of the SQL expression used to retrieve the column. More... | |
IlInt | getColumnTable (IlInt colno) const |
Returns the position of the table reference that the column is mapped to. More... | |
IlBoolean | getConcurrencyControl () const |
Returns IlTrue if concurrency control is enabled for the SQL table. More... | |
IlInt | getConjunctsCount (IlBoolean wherePart) const |
Returns the number of conjuncts defined for the SQL table. More... | |
IlInt | getCursorBufferedRowsCount () const |
Returns the number of buffered rows. More... | |
IliSQLSession * | getEffectiveSQLSession () const |
Returns the effective SQL session object of the table. More... | |
IliFetchPolicy | getFetchPolicy () const |
Returns the fetch policy of the SQL table. More... | |
IlBoolean | getJoin (IlInt jno, IlInt &tblNo1, IliAttributePath &colName1, IlInt &tblNo2, IliAttributePath &colName2) const |
Returns the definition of the join. More... | |
IlInt | getJoinIndex (IlInt token) const |
Returns the position of a join. More... | |
IlInt | getJoinsCount () const |
Returns the number of joins that have been defined for the SQL table. More... | |
IlInt | getJoinToken (IlInt jno) const |
Returns the token of the join. More... | |
IliSQLJoinType | getJoinType (IlInt jno) const |
Returns the type of the join. More... | |
const char * | getQuery () const |
Returns the SQL SELECT statement that will be used to query the database. More... | |
const char * | getQueryConjunct () const |
Returns the condition that will be combined with the query defined on the SQL table, to derive the effective query that will be submitted to the remote database. More... | |
virtual IlInt | getRowsCount () const |
Returns the number of rows in the table. More... | |
IlInt | getRowsCountLimit () const |
Returns the maximum number of rows that can be stored in the local memory cache. More... | |
IliSQLSession * | getSQLSession () const |
Returns the SQL session object of the table. More... | |
const char * | getTableAlias (IlInt tblno) const |
Returns the alias of one table. More... | |
IlInt | getTableIndex (const char *alias) const |
Returns the position of the table reference. More... | |
IlInt | getTableIndex (IlInt token) const |
Returns the index of the table reference. More... | |
const char * | getTableParentDataSourceName (IlInt tblno) const |
Returns the name of the parent data source for the table. More... | |
IliAttributePath | getTableParentPath (IlInt tblno) const |
Returns the path to the nested table for the table. More... | |
IliRowPtr | getTableParentRow (IlInt tblno) const |
Returns the parent row for the table. More... | |
IliSQLTable * | getTableParentSQLTable (IlInt tblno) const |
Returns the parent SQL table for the table. More... | |
const char * | getTableParentTableAlias (IlInt tblno) const |
Returns the alias of the database table that identifies the parent row. More... | |
IlInt | getTableParentTableIndex (IlInt tblno) const |
Returns the index of the database table that identifies the parent row. More... | |
IlvRect | getTableRect (IlInt tblno) const |
Returns the rectangle of the table reference. More... | |
const IliSQLTableRef & | getTableRef (IlInt tblno) const |
Returns a table reference. More... | |
IlInt | getTablesCount () const |
Returns the number of tables in the "from" clause of the query. More... | |
IlInt | getTableToken (IlInt tblno) const |
Returns the token of the table reference. More... | |
virtual IlBoolean | getValue (IlInt r, IlInt c, IliValue &) const |
Returns a value. More... | |
void | insertConjunct (IlInt cno, IlBoolean wherePart) |
Adds a new conjunct. More... | |
void | insertNulls (IlBoolean f) |
Sets the insert-nulls mode for the SQL table. More... | |
virtual IlBoolean | insertRow (IlInt r, IliTableBuffer *) |
Inserts a row that is defined by the table buffer. More... | |
IlBoolean | isAsyncCallCompleted () const |
Returns IlTrue if the last call to one of the asynchronous-enabled member functions (select , fetchNext , and fetchAll ) has completed. More... | |
IlBoolean | isColumnFetched (IlInt colno) const |
Returns IlTrue if the column should be part of the result computed by the query. More... | |
IlBoolean | isDistinct () const |
Returns IlTrue if the duplicate rows should be removed from the query result. More... | |
IlBoolean | isInAsyncMode () const |
Returns IlTrue if the SQL table is in asynchronous mode. More... | |
IlBoolean | isInsertingNulls () const |
Returns IlTrue if the SQL table includes any NULL columns when it constructs the INSERT SQL statement required to insert a row into a database. More... | |
IlBoolean | isNoWaitOnLockRowEnabled () const |
The return value from this member function is only meaningful when the SQL session connects to an Oracle database server. More... | |
IlBoolean | isNoWaitOnLockRowSupported () const |
Returns IlTrue if the enableNoWaitOnLockRow member function is in effect. More... | |
virtual IlBoolean | isQueryModeSupported () const |
Returns IlTrue if the table supports query mode. More... | |
virtual IlBoolean | isSelectDone () const |
Returns IlTrue if the select member function has been called since the object was constructed. More... | |
IlBoolean | isTableUpdatable (IlInt tblno) const |
Returns IlTrue if the table referenced at position tblno can be updated through this SQL table object. More... | |
IlBoolean | isUsingBoundVariables () const |
Returns IlTrue if the bind-vars mode of the SQL table is enabled. More... | |
IlBoolean | isUsingDynamicSQL () const |
Returns IlTrue if the SQL table is in dynamic-SQL mode. More... | |
IlBoolean | makeQuery () |
Causes the SQL table to compute the SQL SELECT statement that will be used to query the database. More... | |
virtual IliTable * | makeQueryTable () const |
Returns a memory table having the same number of columns as this table. More... | |
virtual IlBoolean | moveRow (IlInt from, IlInt to) |
Moves a row. More... | |
virtual IlBoolean | refreshAndLockRow (IlInt rowno) |
Re-reads the row from the remote database. More... | |
virtual IlBoolean | refreshRow (IlInt rowno) |
Re-reads the row from the remote database. More... | |
IlBoolean | removeTable (IlInt tblno) |
Removes a table reference. More... | |
virtual IlBoolean | select () |
Reads all rows from a remote database. More... | |
void | setAutoCommit (IlBoolean f) |
Sets the auto-commit mode for the SQL table. More... | |
void | setAutoRefresh (IlBoolean f) |
Sets the auto-refresh mode for the SQL table. More... | |
void | setCache (IliTable *cache) |
Sets the IliTable used by the IliSQLTable to manage the local row cache. More... | |
void | setColumnDesignWidth (IlInt colno, IlInt width) |
Sets the design width of the column. More... | |
virtual void | setColumnFetched (IlInt colno, IlBoolean f) |
Sets the fetched property of the column. More... | |
virtual void | setColumnOperation (IlInt colno, IliSQLOperation op) |
Sets the operation requested for the column. More... | |
virtual void | setColumnOrderBy (IlInt colno, IliSQLOrderByType order) |
Sets the order requested for the column. More... | |
void | setColumnPredicat (IlInt colno, IlInt cno, const char *predicat, IlBoolean wherePart) |
Sets the predicate of the column in the conjunct. More... | |
virtual void | setColumnSQLText (IlInt colno, const char *text) |
Sets the SQL text of the column. More... | |
virtual void | setColumnTable (IlInt colno, IlInt tblno) |
Sets the table reference onto which the column should be mapped. More... | |
void | setConcurrencyControl (IlBoolean cc) |
Enables/disables concurrency control for the SQL table. More... | |
void | setCursorBufferedRowsCount (IlInt count) |
Sets the number of buffered rows to count. More... | |
void | setDistinct (IlBoolean f) |
Sets the distinct property of the SQL table. More... | |
void | setFetchPolicy (IliFetchPolicy fp) |
Sets the fetch policy of the SQL table. More... | |
void | setJoinType (IlInt jno, IliSQLJoinType type) |
Sets the type of the join. More... | |
void | setQuery (const char *query) |
Sets the query on the SQL table. More... | |
void | setQueryConjunct (const char *condition) |
Sets the condition that will be combined with the query defined on the SQL table, to derive the effective query that will be submitted to the remote database. More... | |
IlBoolean | setQueryFrom (const IliSQLTableRef &tblRef) |
Defines the SQL table in such a way that it will map onto the database table indicated. More... | |
void | setRowsCountLimit (IlInt size) |
Sets the rows count limit of the SQL table. More... | |
void | setSQLSession (IliSQLSession *session) |
Sets the SQL session object of the table. More... | |
void | setTableParentDataSourceName (IlInt tblno, const char *name) |
Sets the name of the parent data source for the table. More... | |
void | setTableParentPath (IlInt tblno, const IliAttributePath &path) |
Sets the path to the nested table for the table. More... | |
void | setTableParentRow (IlInt tblno, const IliRowPtr &row) |
Sets the parent row for the table. More... | |
void | setTableParentSQLTable (IlInt tblno, IliSQLTable *sqlTbl) |
Sets the parent SQL table for the table. More... | |
void | setTableParentTableAlias (IlInt tblno, const char *name) |
Sets the alias of the database table that identifies the parent row. More... | |
void | setTableRect (IlInt tblno, const IlvRect &rect) |
Sets the rectangle of the table reference. More... | |
void | setTableRef (IlInt tblno, const IliSQLTableRef &tblRef) |
Replaces a table reference. More... | |
void | setTableUpdatable (IlInt tblno, IlBoolean flag) |
Changes the updatable property of the table reference. More... | |
virtual IlBoolean | updateRow (IlInt r, IliTableBuffer *) |
Updates a row with the values in the table buffer. More... | |
void | useBoundVariables (IlBoolean f) |
Sets the bind-vars mode of the SQL table. More... | |
void | useDynamicSQL (IlBoolean f) |
Sets the dynamic-SQL mode for the SQL table. More... | |
virtual void | write (IL_STDPREF ostream &output) const |
Writes the definition of the SQL table to an output stream, in a form suitable to be read back by the stream-based constructor. More... | |
Public Member Functions inherited from IliMemoryTable | |
IliMemoryTable (IlvDisplay *display) | |
Constructor. More... | |
IliMemoryTable (IlvDisplay *display, IlInt rowCnt, const char *const *values, IlInt colCnt=1, const char *const *headers=0) | |
Constructor from a description. More... | |
IliMemoryTable (const IliMemoryTable &tbl) | |
Copy constructor. More... | |
virtual IlBoolean | allowRowMove () const |
Returns IlTrue if the table (or subclass of the table) allows row move operations. More... | |
virtual IlBoolean | deleteRowInCache (IlInt rowno) |
Deletes a row. More... | |
virtual IlBoolean | exchangeRowsInCache (IlInt rowno1, IlInt rowno2) |
Exchanges two rows. More... | |
virtual IliRowStatus | getRowStatus (IlInt rowno) const |
Returns the status of one row. More... | |
virtual IlBoolean | insertRowInCache (IlInt rowno, IliTableBuffer *) |
Inserts a row that is defined by the table buffer. More... | |
virtual IlBoolean | moveRowInCache (IlInt from, IlInt to) |
Moves a row. More... | |
virtual void | setColumnMaxLength (IlInt, IlInt) |
Sets the maximum length for one column. More... | |
virtual void | setColumnNullable (IlInt, IlBoolean) |
Determines if the column positioned at colno is nullable (that is, may contain null values). More... | |
virtual void | setColumnType (IlInt, const IliDatatype *) |
Sets the type of the column. More... | |
virtual IlBoolean | updateRowInCache (IlInt rowno, IliTableBuffer *) |
Updates a row. More... | |
Public Member Functions inherited from IliTable | |
void | addErrorSink (IliErrorSink *sink) |
Adds an error sink. More... | |
IlInt | appendParameter (const char *paramName, const IliDatatype *type, IlInt maxlen=-1) |
Appends a new parameter to the table parameters. More... | |
IlInt | appendRow (IliTableBuffer *tblBuf) |
Appends a new row defined by the table buffer. More... | |
IlInt | appendRowInCache (IliTableBuffer *tblBuf) |
Appends a new row defined by the table buffer. More... | |
IliValue | at (IlInt rowno, IlInt colno) const |
Returns a value. More... | |
IliValue | at (IlInt rowno, IliName colname) const |
Returns a value. More... | |
virtual IlBoolean | checkConstraints (IlInt rowno, IliTableBuffer *buff) const |
Validates the table buffer data. More... | |
IliTable * | copyTable () const |
Returns a copy of the table. More... | |
void | deleteParameter (IlInt paramno) |
Deletes a parameter. More... | |
void | enableColumnCompletion (IlInt colno, IlBoolean flag) |
Specifies whether completion is enabled for the column. More... | |
IlInt | findFirstRow (const IliValue &value, IlInt colno, IlBoolean complete, IlInt fromRow=0, IlInt toRow=-1) const |
Searches for a row located between two positions. More... | |
IlInt | findRow (const IliValue &value, IlInt colno, IlBoolean complete, IlInt fromRow=0, IlInt toRow=-1) const |
Searches for a row located between two positions. More... | |
IliTableBuffer * | getBuffer () |
Returns a table buffer for the table. More... | |
IlBoolean | getColumnDisplayValue (IlInt colno, const IliValue &value, IliValue &displayValue, IlvGraphicHolder *=NULL) |
Returns the display value for a value. More... | |
IliTable * | getColumnEffectiveForeignTable (IlInt colno, IlvGraphicHolder *h=NULL) const |
Returns the effective foreign table. More... | |
const char * | getColumnForeignDataSourceName (IlInt colno) const |
Returns the name of the data source that will provide a foreign table for one column. More... | |
const char * | getColumnForeignDisplayColumn (IlInt colno) const |
Returns the name of the display column in the foreign table. More... | |
IliTable * | getColumnForeignTable (IlInt colno) const |
Returns the foreign table of one column. More... | |
const char * | getColumnForeignValueColumn (IlInt colno) const |
Returns the name of the value column in the foreign table. More... | |
IlAny | getCompareData () const |
Returns the user data that can be used to compare two rows. More... | |
IliCompareFunction | getCompareFunction () const |
Returns the function that is used to compare two rows. More... | |
const IliTablePropertyManager * | getDefaultPropertyManager () const |
Returns the default property manager. More... | |
IliTablePropertyManager * | getDefaultPropertyManager () |
Returns the default property manager. More... | |
IlvGadgetHolder * | getGadgetHolder () const |
Returns the gadget holder to which the table is attached. More... | |
IliTablePropertyManager * | getNamedPropertyManager (const char *name) const |
Returns a property manager from its name. More... | |
IlInt | getNamedPropertyManagerCount () const |
Returns the number of named property managers. More... | |
const char * | getParameterColumnName (IlInt paramno) const |
Returns the name of the column, which the parameter is attached to. More... | |
const char * | getParameterDataSourceName (IlInt paramno) const |
Returns the name of the data source which the parameter is attached to. More... | |
IliValue | getParameterDataSourceValue (IlInt paramno) const |
Returns the current value of one parameter. More... | |
IlInt | getParameterIndex (const char *name) const |
Returns the position of one parameter. More... | |
IlInt | getParameterMaxLength (IlInt paramno) const |
Returns the maximum length allowed for one parameter. More... | |
const char * | getParameterName (IlInt paramno) const |
Returns a parameter name. More... | |
IlInt | getParametersCount () const |
Returns the number of parameters defined for this table. More... | |
const IliDatatype * | getParameterType (IlInt paramno) const |
Returns the parameter type. More... | |
IliValue | getParameterValue (IlInt paramno) const |
Returns the current value of one parameter. More... | |
IliValue | getParameterValue (IliName paramName) const |
Returns the current value of one parameter. More... | |
IlBoolean | getProperty (IlInt rowno, IlInt colno, const IlvSymbol *propName, IliValue &propVal) const |
Returns a property value attached to the part of the table. More... | |
IlInt | getPropertyCount (IlInt rowno, IlInt colno) const |
Returns the property count attached to the part of the table. More... | |
const char * | getPropertyManagerNameAt (IlInt idx) const |
Returns the name of the named property manager. More... | |
const IlvSymbol * | getPropertyNameAt (IlInt rowno, IlInt colno, IlInt propIndex) const |
Returns a property name attached to the part of the table. More... | |
IliRowPtr | getRowPtr (IlInt rowno=-1) const |
Returns an IliRowPtr that points to one row. More... | |
IliTransactionManager * | getTransactionManager () const |
Returns the transaction manager managing the table. More... | |
const char * | getTransactionManagerName () const |
Returns the name of the transaction manager that manages the table. More... | |
virtual IlBoolean | insertRowsFrom (const IliTable *src, IlInt srcFromRow=0, IlInt srcToRow=-1, IlBoolean stopAtFirstError=IlTrue, IlInt insertAt=-1) |
Inserts rows into this table by copying them from another table. More... | |
IlBoolean | isColumnCompletionEnabled (IlInt colno) const |
Returns IlTrue if completion is enabled for the column. More... | |
IlBoolean | isColumnValueConstrained (IlInt colno) const |
Returns IlTrue if the column is constrained to taking its values from the domain of the value column of the foreign table. More... | |
IlBoolean | isModified () const |
Returns IlTrue if the rows of the table have been modified since the last time. More... | |
IliTablePropertyManager * | newNamedPropertyManager (const char *name) |
Creates and returns a new named property manager. More... | |
virtual IliTablePropertyManager * | newPropertyManager () |
Creates and returns a new anonymous property manager. More... | |
void | releaseBuffer (IliTableBuffer *buff) |
Releases a table buffer. More... | |
void | removeErrorSink (IliErrorSink *sink) |
Removes an error sink from this table. More... | |
void | removeNamedPropertyManager (const char *name) |
Removes a property manager. More... | |
void | removeProperty (IlInt rowno, IlInt colno, const IlvSymbol *propName) |
Removes a property from the part of the table. More... | |
IlBoolean | set (IlInt rowno, IlInt colno, const IliValue &value) |
Sets a value. More... | |
IlBoolean | set (IlInt rowno, IliName colname, const IliValue &value) |
Sets a value. More... | |
void | setColumnForeignDataSourceName (IlInt colno, const char *dsname) |
Sets the name of the foreign data source for one column. More... | |
void | setColumnForeignDisplayColumn (IlInt colno, const char *name) |
Sets the name of the display column in the foreign table. More... | |
void | setColumnForeignTable (IlInt colno, IliTable *table) |
Sets the foreign table of one column. More... | |
void | setColumnForeignValueColumn (IlInt colno, const char *name) |
Sets the name of the value column in the foreign table. More... | |
void | setColumnValueConstrained (IlInt colno, IlBoolean flag) |
Specifies that the column is constrained to take its values from the domain of the value column of the foreign table. More... | |
void | setCompareFunction (IliCompareFunction fct, IlAny arg=0) |
Defines the function and user data that must be used to compare two rows. More... | |
void | setGadgetHolder (IlvGadgetHolder *gadHold) |
Attaches the table to a gadget holder. More... | |
IlBoolean | setInCache (IlInt rowno, IlInt colno, const IliValue &value) |
Sets a value. More... | |
virtual void | setModified (IlBoolean flag) |
Sets the value of the modified property of the table. More... | |
void | setParameterColumnName (IlInt paramno, const char *colname) |
Attaches a parameter to one column. More... | |
void | setParameterDataSourceName (IlInt paramno, const char *dsname) |
Attaches one parameter to one data source. More... | |
void | setParameterMaxLength (IlInt paramno, IlInt maxlen) |
Sets the maximum length allowed for the parameter. More... | |
void | setParameterName (IlInt paramno, const char *name) |
Sets a parameter name. More... | |
void | setParameterType (IlInt paramno, const IliDatatype *type) |
Sets the type of one parameter. More... | |
void | setParameterValue (IlInt paramno, const IliValue &value) |
Sets the value of one parameter. More... | |
void | setParameterValue (IliName paramName, const IliValue &value) |
Sets the value of one parameter. More... | |
void | setProperty (IlInt rowno, IlInt colno, const IlvSymbol *propName, const IliValue &propVal) |
Sets a property value to a part of the table. More... | |
void | setTransactionManager (IliTransactionManager *tm) |
Changes the transaction that manages this table. More... | |
void | setTransactionManagerName (const char *name) |
Changes the transaction that manages this table. More... | |
void | sortRows (const IlInt *colnoArray, IlInt columnsCount, IlInt fromRow=0, IlInt toRow=-1, IliCompareFunction fct=0, IlAny data=0) |
Sorts a set of rows. More... | |
void | writeTable (IL_STDPREF ostream &output) const |
Writes the definition of the table to an output stream, in a form suitable to be read back by the ReadTable static member function. More... | |
Public Member Functions inherited from IliSchema | |
IliSchema (IlvDisplay *) | |
This constructor initializes a schema object. More... | |
IliSchema (const IliSchema &) | |
This is the copy constructor of the IliSchema class. | |
IliSchema (IlvDisplay *display, IL_STDPREF istream &input) | |
This constructor initializes a schema by reading its definition from an input stream. More... | |
void | addHook (IliTableHook *hook) |
Adds a hook to the list of hooks of the schema object. More... | |
IlInt | appendColumn (const char *name, const IliDatatype *type, IlInt maxlen=-1) |
Appends a new column to the schema. More... | |
const IliDatatype * | asDatatype () const |
Returns the data type that is defined by this schema. More... | |
virtual IlBoolean | deleteColumn (IlInt colno) |
Deletes a column. More... | |
void | endOfBatch () |
Used in conjunction with the startOfBatch member function to terminate a series of modifications on the schema. More... | |
IlvAlignment | getColumnAlignment (IlInt colno) const |
Returns the column alignment. More... | |
const char * | getColumnDefault (IlInt colno) const |
Returns the default value for one column. More... | |
IlInt | getColumnDisplayWidth (IlInt colno) const |
Returns the display width, in pixels, of one column. More... | |
const IliFormat & | getColumnFormat (IlInt colno) const |
Returns the format of one column. More... | |
IlInt | getColumnIndex (const char *name) const |
Returns the position of the column. More... | |
IlInt | getColumnIndex (IlInt token) const |
Returns the position of the column. More... | |
const char * | getColumnLabel (IlInt colno) const |
Returns the label of one column. More... | |
const IliInputMask & | getColumnMask (IlInt colno) const |
Returns the input mask of one column. More... | |
IlInt | getColumnMaxLength (IlInt colno) const |
Returns the maximum length allowed for one column. More... | |
const char * | getColumnName (IlInt colno) const |
Returns the name of the column. More... | |
IlInt | getColumnsCount () const |
Returns the number of columns in the schema. More... | |
const char * | getColumnTitle (IlInt colno) const |
Returns the title of one column. More... | |
IlInt | getColumnToken (IlInt colno) const |
Returns the token of the column. More... | |
const IliDatatype * | getColumnType (IlInt colno) const |
Returns the type of the column. More... | |
IlvDisplay * | getDisplay () const |
Returns the display of the schema object. More... | |
const char * | getElementTypeName () const |
Returns the type name of the objects in the collection. More... | |
const IliSchema * | getNestedSchema (const IliAttributePath &path) const |
Returns the nested schema. More... | |
IliSchema * | getNestedSchema (const IliAttributePath &path) |
Returns the nested schema. More... | |
const char * | getSchemaName () const |
Returns the schema name. More... | |
IlBoolean | hasHook (IliTableHook *hook) const |
Returns True if the hook is already into the list of hooks of the schema object. More... | |
virtual IlBoolean | insertColumn (IlInt colno, const char *colname, const IliDatatype *type, IlInt maxlen=-1) |
Inserts a new column in the schema. More... | |
IlBoolean | isACollection () const |
Returns IlTrue if the schema defines a type that is a collection of objects or values. More... | |
IlBoolean | isASimpleCollection () const |
Returns IlTrue if the schema is defined as a simple collection type. More... | |
IlBoolean | isColumnNullable (IlInt colno) const |
Returns IlTrue if the column allows null values. More... | |
IlBoolean | isColumnPartOfKey (IlInt colno) const |
Returns IlTrue if the column is part of the primary key of the schema. More... | |
IlBoolean | isColumnReadOnly (IlInt colno) const |
Returns IlTrue if the column is read-only. More... | |
IlBoolean | isColumnVisible (IlInt colno) const |
Returns IlTrue if the column should be visible. More... | |
IlBoolean | isPrimaryKeyDefined () const |
Returns IlTrue if the schema has one or more columns defined as being part of the primary key. More... | |
virtual IlBoolean | moveColumn (IlInt from, IlInt to) |
Moves a column. More... | |
void | removeHook (IliTableHook *hook) |
Removes a hook from the list of hooks of the schema object. More... | |
void | setAsCollection (IlBoolean flag) |
Sets the schema as a collection type. More... | |
void | setAsSimpleCollection (IlBoolean flag) |
Sets the schema as a simple collection type. More... | |
virtual void | setColumnAlignment (IlInt colno, IlvAlignment align) |
Sets the alignment of one column. More... | |
virtual void | setColumnDefault (IlInt colno, const char *val) |
Sets the default value for one column. More... | |
virtual void | setColumnDisplayWidth (IlInt colno, IlInt width) |
Sets the display width of one column. More... | |
virtual void | setColumnFormat (IlInt colno, const IliFormat &fmt) |
Sets the format of the column. More... | |
virtual void | setColumnLabel (IlInt colno, const char *label) |
Sets the label of one column. More... | |
virtual void | setColumnMask (IlInt colno, const IliInputMask &mask) |
Sets the input mask of one column. More... | |
virtual void | setColumnName (IlInt colno, const char *colname) |
Sets the name of the column. More... | |
virtual void | setColumnPartOfKey (IlInt colno, IlBoolean partOfKey) |
Specifies whether the column is part of the primary key. More... | |
virtual void | setColumnReadOnly (IlInt colno, IlBoolean readOnly) |
Specifies whether a column is read-only. More... | |
virtual void | setColumnTitle (IlInt colno, const char *title) |
Sets the title of one column. More... | |
virtual void | setColumnVisible (IlInt colno, IlBoolean visible) |
Sets the column visibility. More... | |
void | setElementTypeName (const char *name) |
Sets the element type name. More... | |
void | setSchemaName (const char *name) |
Sets the schema name. More... | |
void | startOfBatch () |
Used to start a series of modifications on the schema object. More... | |
Public Member Functions inherited from IliRefCounted | |
IlInt | getRefCount () const |
Returns the reference count of the object. Initially, this property is set to 0 . More... | |
void | lock () const |
Increments the reference count of the object. | |
void | unLock () const |
Decrements the reference count of the object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IliTable | |
static IliTable * | ReadTable (IlvDisplay *disp, IL_STDPREF istream &input) |
Constructs and returns an instance of a subclass of IliTable by reading its definition from an input stream. More... | |
Protected Member Functions inherited from IliTable | |
virtual void | cellChanged (IlInt rowno, IlInt colno) |
Called just after a cell has changed. More... | |
virtual void | raiseError (const IliErrorMessage &msg) const |
Called each time an error occurs. More... | |
virtual void | rowChanged (IlInt rowno) |
Called just after the row at position rowno has changed (that is, when one or more values in the row have changed). More... | |
virtual void | rowDeleted (IlInt rowno) |
Called just after a row has been removed from the table. More... | |
virtual void | rowFetched (IlInt rowno) |
Called just after a new row has been fetched from a remote database and inserted. More... | |
virtual void | rowInserted (IlInt rowno) |
Called just after a new row has been inserted. More... | |
virtual void | rowMoved (IlInt src, IlInt dest) |
Called just after a row has moved. More... | |
virtual void | rowToBeChanged (IlInt rowno) |
Called just before the row is changed. More... | |
virtual void | rowToBeDeleted (IlInt rowno) |
Called just before a row is removed from the table. More... | |
virtual void | tableChanged () |
Called when the IliTable object has undergone a significant number of changes. More... | |
Table class.
Library: dbaccess
The IliSQLTable
class implements the protocol defined by the IliTable
class, by managing the rows on a remote relational database management system. It is defined in terms of an SQL query that calculates a new table from existing database tables.
The SQL query of an IliSQLTable
can be defined in two different ways:
setQuery
member function, When the SQL query is defined literally, the IliSQLTable
can only be used to read the results of the query evaluation. This differs from defining the query structurally: while the IliSQLTable
is not just used to read values from the database, it can also be used to update the database. Rogue Wave Views Data Access provides an inspector that allows the structural definition of an IliSQLTable
, through a graphical user interface that is more convenient than having to code this definition by calling member functions.
About Table Parent The member functions in this section are needed when one of the tables in the FROM clause has a nested table (that is, it has a column whose type is a table) and columns in this nested table are selected.
Suppose a table named PRODUCT
has a column PARTS
of type TABLE OF PART
.
Suppose an IliSQLTable
selects columns PARTNAME
from table PRODUCT.PARTS.
Since there are as many PARTS
tables as there are rows in table PRODUCT
, the SQL table needs to know in which row of table PRODUCT
it must look for a PARTS
table.
Parent Data Source The setTableParentDataSourceName
member function lets you specify a data source that is expected to be positioned on a given row in table PRODUCTS
. This data source is expected to hold an IliSQLTable
that selects at least the primary key columns of table PRODUCT
.
Parent SQL Table and Row Index Alternatively, the setTableParentSQLTable
and the setTableParentRow
member functions can be used to specify the parent SQL table and the row that contains the nested table. These member functions must be called before the select
member function is called because the SQL SELECT statement may be dependent upon both of these properties.
Parent Table Alias Since the parent SQL table may have more than one table in its FROM clause, it is necessary to specify which of these tables identifies the row in table PRODUCT
. The setParentTableAlias
member function can be used for this purpose.
If the SQL table session has been set up through an SQL data source inspector and if an application-wide session has been selected, then the getEffectiveSQLSession
member function will return the application-wide session.
About Asynchronous Mode If the SQL session of the SQL table is in asynchronous mode, the SQL table will operate in asynchronous mode.
Ili_SQLSessionInAsyncMode
error code: insertRow
, updateRow
, deleteRow
, refreshRow
, and refreshAndLockRow
. select
, fetchNext
, and fetchAll
.IliSQLTable::IliSQLTable | ( | IlvDisplay * | display | ) |
This constructor initializes an SQL table.
Initially, the table definition is empty.
display | The display. |
IliSQLTable::IliSQLTable | ( | IlvDisplay * | , |
IL_STDPREF istream & | input | ||
) |
This constructor initializes an SQL table by reading its definition from an input stream.
input | The input stream. |
IlInt IliSQLTable::addJoin | ( | IlInt | tblNo1, |
const IliAttributePath & | colName1, | ||
IlInt | tblNo2, | ||
const IliAttributePath & | colName2 | ||
) |
Adds a join.
tblNo1 | The table position of the first table. |
colName1 | The column name of the first table. |
tblNo2 | The table position of the second table. |
colName2 | The column name of the second table. |
IlInt IliSQLTable::addJoin | ( | IlInt | tblNo1, |
const char * | colName1, | ||
IlInt | tblNo2, | ||
const char * | colName2 | ||
) |
Adds a join.
tblNo1 | The table position of the first table. |
colName1 | The column name of the first table. |
tblNo2 | The table position of the second table. |
colName2 | The column name of the second table. |
IlInt IliSQLTable::addTable | ( | const IliSQLTableRef & | tblRef | ) |
Adds a table reference to the "from" clause of the query.
Note that the same table reference can be added many times in a query. Each occurrence of that same table reference will be distinguished by a unique alias. Furthermore, each table referenced in an SQL table is automatically given a token (an integer), which is unique and will always remain constant (as opposed to the position or index of a table reference, which may change without notice, when other table references are removed).
tblRef | The table. |
IlInt IliSQLTable::addTableColumn | ( | const IliSQLTableDef * | tblDef, |
IlInt | tblno, | ||
IlInt | colno | ||
) |
Appends a new column.
Calling this member function is similar to adding a column to an SQL data source in an Rogue Wave Views Studio inspector by dragging the column from a database table and dropping it over the SELECT area of the data source.
tblDef | The table definition. |
tblno | The table position in the table definition. |
colno | The column position in the table definition. |
-1
if the column creation fails.
|
virtual |
Returns IlTrue
if columns can be moved to this schema.
The reason why columns can or cannot be moved depends on the specific subclass of IliSchema
that is used.
IlTrue
if columns can be moved to this schema, and IlFalse
otherwise. Reimplemented from IliMemoryTable.
Applies the query specified by the conditions contained in the provided table.
If query mode is supported, applies the query specified by the conditions contained in the queryTable
parameter, which is expected to be a table obtained by calling the makeQueryTable
virtual member function.
queryTable | The table. |
IlTrue
if successful. Reimplemented from IliTable.
IlBoolean IliSQLTable::cancelAsyncCall | ( | ) |
Cancels all the asynchronous calls that are not completed.
IlTrue
if successful.
|
virtual |
Deletes all rows.
If the table (or subclass of the table) defines a mapping with a remote database, then only the rows in the IliTable
object are deleted. The rows in the remote database are not affected by this operation. This enables the row cache of such a table to be cleared.
Reimplemented from IliMemoryTable.
IlBoolean IliSQLTable::continueAsyncCall | ( | ) |
If there is an asynchronous call in progress, this member function again calls the asynchronous-enabled member function that is not completed.
The isAsyncCallCompleted
can then be called to check whether the call has been completed.
IlTrue
if the call is successful and IlFalse
otherwise. Deletes a conjunct.
cno | The conjunct position. |
wherePart | If IlTrue , deletes to the WHERE clause. If wherePart is IlFalse , the conjunct is deleted to the HAVING clause. |
void IliSQLTable::deleteJoin | ( | IlInt | jno | ) |
Deletes a join.
jno | The join position. |
Deletes a row.
rowno | The row position. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be deleted. If the table (or subclass of the table) defines a mapping with a remote database, the row is also deleted in the remote database. Reimplemented from IliMemoryTable.
void IliSQLTable::enableNoWaitOnLockRow | ( | IlBoolean | nowait | ) |
Specifies whether "waiting on row locking" is enabled.
The only database system that supports this feature is Oracle. With other database systems, calling this member function has no effect.
nowait | If IlTrue , "waiting on row locking" is enabled. |
Exchanges two rows.
rowno1 | The first row position. |
rowno2 | The second row position. |
IlTrue
if successful. If the table (or subclass of the table) defines a mapping with a remote database, the rows are also exchanged in the remote database (if possible). Reimplemented from IliMemoryTable.
|
virtual |
Fetches all remaining rows and stores them in the local row cache.
Reimplemented from IliTable.
|
virtual |
Returns IlTrue
, if all the rows have been fetched from the database and stored in the local row cache.
The table (or subclass of the table) must define a mapping with a database.
IlTrue
, if all the rows have been fetched from the database and stored in the local row cache. Reimplemented from IliTable.
Fetches up a number of rows from the database and stores them in the local row cache.
count | The row count. |
Reimplemented from IliTable.
IlInt IliSQLTable::findJoin | ( | IlInt | tblNo1, |
const IliAttributePath & | colName1, | ||
IlInt | tblNo2, | ||
const IliAttributePath & | colName2 | ||
) | const |
Returns the position of the join which corresponds to the definition.
tblNo1 | The table position of the first table. |
colName1 | The column name of the first table. |
tblNo2 | The table position of the second table. |
colName2 | The column name of the second table. |
-1
if there is no such join. Note that this member function considers joins to be symmetric, so the order of the table references does not matter. IlBoolean IliSQLTable::getAutoCommit | ( | ) | const |
Returns IlTrue
if the SQL table is in auto-commit mode.
In this mode, the SQL table commits the transaction immediately after any INSERT
, UPDATE
, or DELETE
operations. When auto-commit is disabled, the user must commit the transaction (through the effective SQL session), as required. Initially, this property is set to IlTrue
.
IlTrue
if the SQL table is in auto-commit mode. IlBoolean IliSQLTable::getAutoRefresh | ( | ) | const |
Returns IlTrue
if the SQL table is in auto-refresh mode.
In this mode, any INSERT
or UPDATE
operation on the database is immediately followed by a request, to the database, for the inserted or updated row. The row obtained by this request replaces the inserted or updated row, in the SQL table. This is sometimes useful when the database contains triggers which may alter inserted or modified rows. Initially, this property is set to IlFalse
.
IlTrue
if the SQL table is in auto-refresh mode. IliTable* IliSQLTable::getCache | ( | ) | const |
Returns the IliTable
that manages the local row cache.
Initially, this property is NULL
.
IliTable
that manages the local row cache or NULL
if the cache is managed by the IliSQLTable
itself (through the IliMemoryTable
class from which it inherits). const IliSQLCatalog& IliSQLTable::getCatalog | ( | ) | const |
Returns the catalog of the SQL table.
A catalog is a set of database table definitions.
IliSQLCatalog& IliSQLTable::getCatalog | ( | ) |
Returns the catalog of the SQL table.
A catalog is a set of database table definitions.
Returns the design width, in pixels, of the column.
colno | The column position. |
IliSQLTable
inspector. IliSQLOperation IliSQLTable::getColumnOperation | ( | IlInt | colno | ) | const |
Returns the operation requested for the column.
colno | The column position. |
IliSQLScalar
, IliSQLGroupBy
, IliSQLCount
, IliSQLSum
, IliSQLAvg
, IliSQLMin
, or IliSQLMax
. The default is IliSQLScalar
. IliSQLOrderByType IliSQLTable::getColumnOrderBy | ( | IlInt | colno | ) | const |
Returns the order requested for the column.
colno | The column position. |
IliSQLNoOrder
, IliSQLAscending
or IliSQLDescending
. The default is IliSQLNoOrder
. Returns the predicate for the column in the conjunct.
colno | The column position. |
cno | The conjunct position. |
wherePart | If IlTrue , from the WHERE clause, otherwise from the HAVING clause. |
const char* IliSQLTable::getColumnSQLText | ( | IlInt | colno | ) | const |
Returns the text of the SQL expression used to retrieve the column.
If this column is mapped onto a column of a database table, the SQL text will be the name of the database table column. If the column is defined as being computed, the SQL text will be the expression that computes the column.
colno | The column position. |
Returns the position of the table reference that the column is mapped to.
The default is -1
.
colno | The column position. |
-1
if this column is not directly mapped onto a table column. IlBoolean IliSQLTable::getConcurrencyControl | ( | ) | const |
Returns IlTrue
if concurrency control is enabled for the SQL table.
When concurrency control is enabled, the updating and deletion of rows in this SQL table will only succeed if the rows concerned have not changed in the database since the last time they were fetched and stored in the local memory cache. In other words, concurrency control obliges the SQL table to protect the work carried out through it from the work of other users on the database. Initially, this property is set to IlFalse
.
IlTrue
if concurrency control is enabled for the SQL table. Returns the number of conjuncts defined for the SQL table.
wherePart | If IlTrue , the conjuncts that constitute the WHERE clause are counted, whereas, if it is IlFalse , the conjuncts that constitute the HAVING clause are counted. |
IlInt IliSQLTable::getCursorBufferedRowsCount | ( | ) | const |
Returns the number of buffered rows.
setBufferedRowsCount
member function). Note that this property bears no relationship to the local row cache of the SQL table. It refers to a lower-level buffering mechanism. IliSQLSession* IliSQLTable::getEffectiveSQLSession | ( | ) | const |
Returns the effective SQL session object of the table.
This is not necessarily the same as the SQL session object returned by the getSQLSession
member function. In any case, all communication between the SQL table and a remote database system goes through the effective SQL session object.
IliFetchPolicy IliSQLTable::getFetchPolicy | ( | ) | const |
Returns the fetch policy of the SQL table.
The default for this property is IliFP_AsNeeded
.
IlBoolean IliSQLTable::getJoin | ( | IlInt | jno, |
IlInt & | tblNo1, | ||
IliAttributePath & | colName1, | ||
IlInt & | tblNo2, | ||
IliAttributePath & | colName2 | ||
) | const |
Returns the definition of the join.
jno | The join position. |
tblNo1 | The table position of the first table. |
colName1 | The column name of the first table. |
tblNo2 | The table position of the second table. |
colName2 | The column name of the second table. |
IlTrue
if successful. Returns the position of a join.
token | The join token. |
-1
if no such join exists. IlInt IliSQLTable::getJoinsCount | ( | ) | const |
Returns the number of joins that have been defined for the SQL table.
Returns the token of the join.
Tokens are automatically assigned to joins, and will always remain constant (as opposed to the position of a join, which may change without notice when other joins are removed).
jno | The join position. |
-1
if no such join exists. IliSQLJoinType IliSQLTable::getJoinType | ( | IlInt | jno | ) | const |
Returns the type of the join.
jno | The join position. |
const char* IliSQLTable::getQuery | ( | ) | const |
Returns the SQL SELECT
statement that will be used to query the database.
SQL SELECT
statement that will be used to query the database. const char* IliSQLTable::getQueryConjunct | ( | ) | const |
Returns the condition that will be combined with the query defined on the SQL table, to derive the effective query that will be submitted to the remote database.
WHERE
part of the query, and with an AND
Boolean operator. Initially, this property is set to the empty character string.
|
virtual |
IlInt IliSQLTable::getRowsCountLimit | ( | ) | const |
Returns the maximum number of rows that can be stored in the local memory cache.
When this limit is reached, no more rows will be fetched from the database, and no insert operations will be allowed for the IliSQLTable
. A value of -1
means that there is no limit. Initially, this property is set to 500
.
IliSQLSession* IliSQLTable::getSQLSession | ( | ) | const |
Returns the SQL session object of the table.
const char* IliSQLTable::getTableAlias | ( | IlInt | tblno | ) | const |
Returns the alias of one table.
tblno | The table reference position. |
IlInt IliSQLTable::getTableIndex | ( | const char * | alias | ) | const |
Returns the position of the table reference.
alias | The table reference alias. |
-1
if no such table reference exists. Returns the index of the table reference.
token | The table reference token. |
-1
if no such table reference exists. const char* IliSQLTable::getTableParentDataSourceName | ( | IlInt | tblno | ) | const |
Returns the name of the parent data source for the table.
tblno | The table reference position. |
IliAttributePath IliSQLTable::getTableParentPath | ( | IlInt | tblno | ) | const |
Returns the path to the nested table for the table.
tblno | The table reference position. |
Returns the parent row for the table.
tblno | The table reference position. |
IliSQLTable* IliSQLTable::getTableParentSQLTable | ( | IlInt | tblno | ) | const |
Returns the parent SQL table for the table.
tblno | The table reference position. |
const char* IliSQLTable::getTableParentTableAlias | ( | IlInt | tblno | ) | const |
Returns the alias of the database table that identifies the parent row.
tblno | The table reference position. |
Returns the index of the database table that identifies the parent row.
This index is relative to the FROM clause of the parent SQL table.
tblno | The table reference position. |
Returns the rectangle of the table reference.
This rectangle is only used at design time by the IliSQLTable
inspector.
tblno | The table reference position. |
const IliSQLTableRef& IliSQLTable::getTableRef | ( | IlInt | tblno | ) | const |
Returns a table reference.
tblno | The table reference position. |
IlInt IliSQLTable::getTablesCount | ( | ) | const |
Returns the number of tables in the "from" clause of the query.
Returns the token of the table reference.
tblno | The table reference position. |
|
virtual |
Returns a value.
This member function handles the fetching of the row (and all preceding rows) as necessary.
rowno | The row position. |
colno | The column position. |
value | The value. |
IlTrue
if successful. Reimplemented from IliMemoryTable.
Adds a new conjunct.
cno | The conjunct position. |
wherePart | If IlTrue , adds to the WHERE clause. If wherePart is IlFalse , the conjunct is added to the HAVING clause. |
void IliSQLTable::insertNulls | ( | IlBoolean | f | ) |
Sets the insert-nulls mode for the SQL table.
f | If IlTrue , the insert-nulls mode is on. |
|
virtual |
Inserts a row that is defined by the table buffer.
Not all the values are used to insert the row, instead the values for which the isModified
are used, the others being replaced by null values. Note that this member function does not check any of the constraints defined in the schema. If the table (or subclass of the table) defines a mapping with a remote database, the row is also inserted in the remote database.
rowno | The row position. |
buff | The table buffer. |
IlTrue
if successful, and IlFalse
if rowno
is out of bounds, or if the row could not be inserted. Reimplemented from IliMemoryTable.
IlBoolean IliSQLTable::isAsyncCallCompleted | ( | ) | const |
Returns IlTrue
if the last call to one of the asynchronous-enabled member functions (select
, fetchNext
, and fetchAll
) has completed.
IlTrue
if the last call to one of the asynchronous-enabled member functions (select
, fetchNext
, and fetchAll
) has completed. If this member function returns IlFalse
, it is necessary to call the asynchronous-enabled member function (with the same parameter values) periodically until isAsyncCallCompleted
returns IlTrue
. Returns IlTrue
if the column should be part of the result computed by the query.
The default is IlTrue
.
colno | The column position. |
IlTrue
if the column should be part of the result computed by the query. A value of IlFalse
means that the column is only used to specify a condition. IlBoolean IliSQLTable::isDistinct | ( | ) | const |
Returns IlTrue
if the duplicate rows should be removed from the query result.
This property is referred to as the distinct property, and is initially set to IlFalse
. Note that this property is used by the makeQuery
member function. It is not taken into account if the query was set with the setQuery
member function.
IlTrue
if the duplicate rows should be removed from the query result. IlBoolean IliSQLTable::isInAsyncMode | ( | ) | const |
Returns IlTrue
if the SQL table is in asynchronous mode.
IlTrue
if the SQL table is in asynchronous mode. This occurs when the SQL session of the SQL table is itself in asynchronous mode. IlBoolean IliSQLTable::isInsertingNulls | ( | ) | const |
Returns IlTrue
if the SQL table includes any NULL
columns when it constructs the INSERT SQL statement required to insert a row into a database.
When NULL
columns are included, any default values defined in the table schema of the database are not taken into account, since a NULL
value will be explicitly specified. On the other hand, when no default values are defined in the database, performance may be increased by including NULL
columns. This is referred to as the insert-nulls mode. Initially, this property is set to IlTrue
.
IlTrue
if the SQL table includes any NULL
columns when it constructs the INSERT SQL statement required to insert a row into a database. IlBoolean IliSQLTable::isNoWaitOnLockRowEnabled | ( | ) | const |
The return value from this member function is only meaningful when the SQL session connects to an Oracle database server.
IlTrue
if the SQL SELECT statements used to lock rows will include the NOWAIT clause. The effect will be that calls to refreshAndLockRow
will immediately fail, if the given row is locked by another session in the database, instead of waiting until the lock is released. This property is useful in implementing the "pessimistic concurrency
control" policy. Initially, this property is set to IlFalse
. IlBoolean IliSQLTable::isNoWaitOnLockRowSupported | ( | ) | const |
Returns IlTrue
if the enableNoWaitOnLockRow
member function is in effect.
IlTrue
if the enableNoWaitOnLockRow
member function is in effect.
|
virtual |
Returns IlTrue
if the table supports query mode.
IlTrue
if the table supports query mode. Reimplemented from IliTable.
|
virtual |
Returns IlTrue
if the select
member function has been called since the object was constructed.
IlTrue
if the select
member function has been called since the object was constructed. Reimplemented from IliTable.
Returns IlTrue
if the table referenced at position tblno
can be updated through this SQL table object.
tblno | The table reference position. |
IlTrue
if the table referenced at position tblno
can be updated through this SQL table object. IlBoolean IliSQLTable::isUsingBoundVariables | ( | ) | const |
Returns IlTrue
if the bind-vars mode of the SQL table is enabled.
In this mode, any column values that need to be sent to the database are packaged in bound variables of the native database call interface, instead of being part of the SQL statements. This setting, combined with the dynamic-SQL mode (disabled) and insert-nulls mode (enabled), enables a dramatic boost in performance, since it allows the IliSQLTable
always to use the same statements for the INSERT
, UPDATE
and DELETE
operations. Initially, this property is set to IlTrue
.
IlTrue
if the bind-vars mode of the SQL table is enabled. IlBoolean IliSQLTable::isUsingDynamicSQL | ( | ) | const |
Returns IlTrue
if the SQL table is in dynamic-SQL mode.
This mode affects the way in which SQL UPDATE
statements are constructed, when a row needs to be modified in the database. Such an UPDATE
statement may set the values of all columns of the remote table in the IliSQLTable
, or it may only set those columns of the remote table whose values have been changed in IliSQLTable
. When dynamic-SQL mode is on, the quantity of data exchanged with the database is reduced, since not all column values need to be sent each time a row is updated. Alternatively, when dynamic-SQL mode is disabled, although the communication overhead is higher, the overall processing time may well be reduced if the bind-vars mode is also enabled, since the SQL UPDATE
statement sent to the database remains constant across updates (and therefore the database processing overhead required to parse the statement and select an access path will be dramatically reduced). Initially, this property is set to IlTrue
.
IlTrue
if the SQL table is in dynamic-SQL mode. IlBoolean IliSQLTable::makeQuery | ( | ) |
Causes the SQL table to compute the SQL SELECT
statement that will be used to query the database.
It is usually called once after the SQL table has been defined.
IlTrue
if successful.
|
virtual |
Returns a memory table having the same number of columns as this table.
If query mode is supported, creates and returns a memory table having the same number of columns as this table. The returned memory table columns are all of the String type.
Reimplemented from IliTable.
Moves a row.
from | The origin row position. |
to | The destination row position. |
IlTrue
if successful. If the table (or subclass of the table) defines a mapping with a remote database, the row is also moved in the remote database (if possible). Reimplemented from IliMemoryTable.
Re-reads the row from the remote database.
If concurrency control is enabled, this member function will succeed only if the remote row has not changed since the last time it was fetched. In other words, this member function is sensitive to whether concurrency control is enabled. This contrasts with the refreshRow
member function which is not sensitive to whether concurrency control is enabled. In addition, the FOR UPDATE SQL
keywords are used in the SQL statement to retrieve the row so that its underlying database row(s) is(are) locked in the database server.
Note that some database systems may impose restrictions on which SQL SELECT statements can be used for the FOR UPDATE
keywords. This occurs particularly when there is more than one table in the FROM
section. In the case of SYBASE, the holdlock
keyword is used instead of FOR UPDATE
.
rowno | The row position. |
IlTrue
if successful and IlFalse
otherwise. Reimplemented from IliTable.
Re-reads the row from the remote database.
This member function is not sensitive to whether concurrency control is enabled. In other words, it will always attempt to re-read the remote row.
rowno | The row position. |
IlTrue
if successful and IlFalse
otherwise. Reimplemented from IliTable.
Removes a table reference.
tblno | The table reference position. |
IlTrue
if successful.
|
virtual |
Reads all rows from a remote database.
If the table (or subclass of the table) defines a mapping with a remote database, this member function clears the local row cache, and queries the database to obtain a new, up-to-date, set of rows.
IlTrue
if successful, and IlFalse
otherwise. Reimplemented from IliTable.
void IliSQLTable::setAutoCommit | ( | IlBoolean | f | ) |
Sets the auto-commit mode for the SQL table.
f | If IlTrue , the auto-commit mode is on. |
void IliSQLTable::setAutoRefresh | ( | IlBoolean | f | ) |
Sets the auto-refresh mode for the SQL table.
f | If IlTrue , the auto-refresh mode is on. |
void IliSQLTable::setCache | ( | IliTable * | cache | ) |
Sets the IliTable
used by the IliSQLTable
to manage the local row cache.
cache | If NULL , the IliSQLTable will manage the local row cache itself. |
Sets the design width of the column.
colno | The column position. |
width | The width. |
Sets the fetched property of the column.
colno | The column position. |
f | If IlTrue , the fetched property is on. |
|
virtual |
Sets the operation requested for the column.
colno | The column position. |
op | The operation. |
|
virtual |
Sets the order requested for the column.
colno | The column position. |
order | The order requested for the column. |
void IliSQLTable::setColumnPredicat | ( | IlInt | colno, |
IlInt | cno, | ||
const char * | predicat, | ||
IlBoolean | wherePart | ||
) |
Sets the predicate of the column in the conjunct.
colno | The column position. |
cno | The conjunct position |
predicat | The predicate. |
wherePart | If IlTrue , from the WHERE clause, otherwise from the HAVING clause. |
|
virtual |
Sets the SQL text of the column.
colno | The column position. |
text | The SQL text, that is copied. |
Sets the table reference onto which the column should be mapped.
colno | The column position. |
tblno | The table position or -1 if the column is not directly mapped onto a table column. |
void IliSQLTable::setConcurrencyControl | ( | IlBoolean | cc | ) |
Enables/disables concurrency control for the SQL table.
cc | If IlTrue , enables concurrency control for the SQL table. |
void IliSQLTable::setCursorBufferedRowsCount | ( | IlInt | count | ) |
Sets the number of buffered rows to count.
count | The count. |
void IliSQLTable::setDistinct | ( | IlBoolean | f | ) |
Sets the distinct property of the SQL table.
f | If IlTrue , the distinct property is on. |
void IliSQLTable::setFetchPolicy | ( | IliFetchPolicy | fp | ) |
Sets the fetch policy of the SQL table.
fp | The fetch policy which must be one of the IliFP_AsNeeded or IliFP_Immediate values. A value of IliFP_AsNeeded means that the SQL table should only fetch rows from the database when necessary, whereas, a value of IliFP_Immediate requires that the SQL table fetch all rows resulting from an SQL SELECT statement as soon as possible. Note that the IliFP_AsNeeded setting is only effective when auto-commit is disabled. |
void IliSQLTable::setJoinType | ( | IlInt | jno, |
IliSQLJoinType | type | ||
) |
Sets the type of the join.
jno | The join position. |
type | The join type. |
void IliSQLTable::setQuery | ( | const char * | query | ) |
Sets the query on the SQL table.
If this member function is called instead of the makeQuery
member function, it is assumed that the correct schema (set of columns) has been defined for this SQL table. Note that the query
parameter is copied by this member function.
query | The query. |
void IliSQLTable::setQueryConjunct | ( | const char * | condition | ) |
Sets the condition that will be combined with the query defined on the SQL table, to derive the effective query that will be submitted to the remote database.
condition | The condition. |
IlBoolean IliSQLTable::setQueryFrom | ( | const IliSQLTableRef & | tblRef | ) |
Defines the SQL table in such a way that it will map onto the database table indicated.
When this member function is called, the schema of the designated table is read from the database catalog, and the SQL table is defined as a query that retrieves all columns and all rows from this table. This member function must be called for an SQL table that is not already defined.
tblRef | The database table. |
IlTrue
if successful and IlFalse
otherwise. void IliSQLTable::setRowsCountLimit | ( | IlInt | size | ) |
Sets the rows count limit of the SQL table.
size | The maximum size. |
void IliSQLTable::setSQLSession | ( | IliSQLSession * | session | ) |
Sets the SQL session object of the table.
session | The SQL session. |
void IliSQLTable::setTableParentDataSourceName | ( | IlInt | tblno, |
const char * | name | ||
) |
Sets the name of the parent data source for the table.
tblno | The table reference position. |
name | The data source name. |
void IliSQLTable::setTableParentPath | ( | IlInt | tblno, |
const IliAttributePath & | path | ||
) |
Sets the path to the nested table for the table.
tblno | The table reference position. |
path | The path. |
Sets the parent row for the table.
tblno | The table reference position. |
row | The parent row. |
void IliSQLTable::setTableParentSQLTable | ( | IlInt | tblno, |
IliSQLTable * | sqlTbl | ||
) |
Sets the parent SQL table for the table.
tblno | The table reference position. |
sqlTbl | The SQL table. |
void IliSQLTable::setTableParentTableAlias | ( | IlInt | tblno, |
const char * | name | ||
) |
Sets the alias of the database table that identifies the parent row.
tblno | The table reference position. |
name | The alias, it should belong to the parent SQL table. |
Sets the rectangle of the table reference.
tblno | The table reference position. |
rect | The rectangle. |
void IliSQLTable::setTableRef | ( | IlInt | tblno, |
const IliSQLTableRef & | tblRef | ||
) |
Replaces a table reference.
tblno | The table reference position. |
tblRef | The new table reference. |
Changes the updatable property of the table reference.
tblno | The table reference position. |
flag | If IlTrue , the table is updatable. |
|
virtual |
Updates a row with the values in the table buffer.
Not all the values are used to update the row. Instead the values for which the isModified
member function returns IlTrue
, are used. Note that this member function does not check any of the constraints defined in the schema. If the table (or subclass of the table) defines a mapping with a remote database, the row is also changed in the remote database.
rowno | The row position. |
buff | The table buffer. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be updated. Reimplemented from IliMemoryTable.
void IliSQLTable::useBoundVariables | ( | IlBoolean | f | ) |
Sets the bind-vars mode of the SQL table.
f | If IlTrue , the bind-vars mode is on. |
void IliSQLTable::useDynamicSQL | ( | IlBoolean | f | ) |
Sets the dynamic-SQL mode for the SQL table.
f | If IlTrue , the dynamic-SQL mode is on. |
|
virtual |
Writes the definition of the SQL table to an output stream, in a form suitable to be read back by the stream-based constructor.
output | The output stream. |
Reimplemented from IliMemoryTable.
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.