Rogue Wave Views
Data Access Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IliSQLTable Class Reference

Table class. More...

#include <ilviews/dataccess/sqltable.h>

Inheritance diagram for IliSQLTable:
IliMemoryTable IliTable IliSchema IliRefCounted

Public Member Functions

 IliSQLTable (IlvDisplay *display)
 Initializes an new SQL table. More...
 
 IliSQLTable (const IliSQLTable &source)
 Copy constructor for the IliSQLTable class. More...
 
 IliSQLTable (IlvDisplay *, IL_STDPREF istream &input)
 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 *)
 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)
 Deletes a row. More...
 
void enableNoWaitOnLockRow (IlBoolean nowait)
 Specifies whether "waiting on row locking" is enabled. More...
 
virtual IlBoolean exchangeRows (IlInt, IlInt)
 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=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
 Indicates if the SQL table is in auto-commit mode. More...
 
IlBoolean getAutoRefresh () const
 Indicates if the SQL table is in auto-refresh mode. More...
 
IliTablegetCache () const
 Returns the IliTable that manages the local row cache. More...
 
const IliSQLCataloggetCatalog () const
 Returns the catalog of the SQL table. More...
 
IliSQLCataloggetCatalog ()
 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
 Indicates if concurrency control is enabled for this 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...
 
IliSQLSessiongetEffectiveSQLSession () 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...
 
IliSQLSessiongetSQLSession () 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...
 
IliSQLTablegetTableParentSQLTable (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 IliSQLTableRefgetTableRef (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, IlInt, 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, IliTableBuffer *)
 Inserts a row that is defined by the table buffer. More...
 
IlBoolean isAsyncCallCompleted () const
 Indicates if the last call to one of the asynchronous-enabled member functions (select(), fetchNext(), and fetchAll()) has completed. More...
 
IlBoolean isColumnFetched (IlInt colno) const
 Indicates if the column should be part of the result computed by the query. More...
 
IlBoolean isDistinct () const
 Indicates if the duplicate rows should be removed from the query result. More...
 
IlBoolean isInAsyncMode () const
 Indicates if the SQL table is in asynchronous mode. More...
 
IlBoolean isInsertingNulls () const
 Indicates if the SQL table includes any 0 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
 Indicates 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
 Indicates if the table referenced at a given position can be updated through this SQL table object. More...
 
IlBoolean isUsingBoundVariables () const
 Indicates if the bind-vars mode of the SQL table is enabled. More...
 
IlBoolean isUsingDynamicSQL () const
 Indicates 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 IliTablemakeQueryTable () const
 Returns a memory table having the same number of columns as this table. More...
 
virtual IlBoolean moveRow (IlInt, IlInt)
 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 or 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, 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 (std::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 rowsCount, const char *const *values, IlInt columnsCount=1, const char *const *columnNames=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)
 Deletes a row. More...
 
virtual IlBoolean exchangeRowsInCache (IlInt, IlInt)
 Exchanges two rows. More...
 
virtual IliRowStatus getRowStatus (IlInt) const
 Returns the status of one row. More...
 
virtual IlBoolean insertRowInCache (IlInt, IliTableBuffer *)
 Inserts a row that is defined by the table buffer. More...
 
virtual IlBoolean moveRowInCache (IlInt, IlInt)
 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, IliTableBuffer *)
 Updates a row. More...
 
virtual void write (IL_STDPREF ostream &output) const
 Writes to output stream. 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...
 
IliTablecopyTable () 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...
 
IliTableBuffergetBuffer ()
 Returns a table buffer for the table. More...
 
IlBoolean getColumnDisplayValue (IlInt colno, const IliValue &value, IliValue &displayValue, IlvGraphicHolder *h=0)
 Returns the display value for a value. More...
 
IliTablegetColumnEffectiveForeignTable (IlInt colno, IlvGraphicHolder *h=0) 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...
 
IliTablegetColumnForeignTable (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 IliTablePropertyManagergetDefaultPropertyManager () const
 Returns the default property manager. More...
 
IliTablePropertyManagergetDefaultPropertyManager ()
 Returns the default property manager. More...
 
IlvGadgetHolder * getGadgetHolder () const
 Returns the gadget holder to which the table is attached. More...
 
IliTablePropertyManagergetNamedPropertyManager (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 IliDatatypegetParameterType (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 IlvSymbolgetPropertyNameAt (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...
 
IliTransactionManagergetTransactionManager () 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...
 
IlBoolean isReadOnly () const
 Returns IlTrue if the table is read-only. More...
 
IliTablePropertyManagernewNamedPropertyManager (const char *name)
 Creates and returns a new named property manager. More...
 
virtual IliTablePropertyManagernewPropertyManager ()
 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...
 
virtual void setReadOnly (IlBoolean readOnly)
 Specifies whether the table is read-only. 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 (std::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 *display)
 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 IliDatatypeasDatatype () 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 IliFormatgetColumnFormat (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 IliInputMaskgetColumnMask (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 IliDatatypegetColumnType (IlInt colno) const
 Returns the type of the column. More...
 
IlvDisplaygetDisplay () 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 IliSchemagetNestedSchema (const IliAttributePath &path) const
 Returns the nested schema. More...
 
IliSchemagetNestedSchema (const IliAttributePath &path)
 Returns the nested schema. More...
 
const char * getSchemaName () const
 Returns the schema name. More...
 
IlBoolean hasHook (IliTableHook *hook) const
 Returns IlTrue 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 IliTableReadTable (IlvDisplay *disp, std::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...
 
- Protected Member Functions inherited from IliRefCounted
virtual ~IliRefCounted ()
 This is the virtual destructor of the IliRefCounted class. More...
 

Detailed Description

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:

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.

CREATE TYPE PART AS OBJECT(
PARTNAME VARCHAR,
WEIGHT INTEGER);
CREATE TABLE PRODUCT(
PRODNAME VARCHAR PRIMARY KEY
PARTS 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.

See also
IliSQLSession, IliSQLTableRef, IliFetchPolicy, IliSQLOperation, IliSQLOrderByType, IliSQLJoinType.

Accessors

Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue(), IlvValueInterface::queryValues(), IlvValueInterface::changeValue(), IlvValueInterface::changeValues(). This class inherits the accessors of its superclass IliMemoryTable and adds the following ones:

Data accessors

Name Type Equivalent methods
augmentedQuery String See [augmentedQuery] below.
autoCommit Boolean getAutoCommit(), setAutoCommit()
autoRefresh Boolean getAutoRefresh(), setAutoRefresh()
cache IliTable getCache(), setCache()
concurrencyControl Boolean getConcurrencyControl(), setConcurrencyControl(). See [concurrencyControl] below.
cursorBufferedRowsCount Int getCursorBufferedRowsCount(), setCursorBufferedRowsCount()
fetchPolicy Object getFetchPolicy(), setFetchPolicy()
insertingNulls Boolean isInsertingNulls(), insertNulls(). See [insertingNulls] below.
noWaitOnLockRow Boolean isNoWaitOnLockRowSupported(), enableNoWaitOnLockRow()
query String getQuery(), setQuery()
queryConjunct String getQueryConjunct(), setQueryConjunct()
rowsCountLimit Int getRowsCountLimit(), setRowsCountLimit()
sqlSession IliSQLSession getEffectiveSQLSession(), setSQLSession()
tableAliasCount Int getTablesCount()
usingBoundVariables Boolean isUsingBoundVariables(), useBoundVariables(). See [usingBoundVariables] below.
usingDynamicSQL Boolean isUsingDynamicSQL(), useDynamicSQL(). See [usingDynamicSQL] below.

[augmentedQuery] Contains the SQL SELECT statement that is the combination of the query and the queryConjunct properties.

[concurrencyControl] As an example, if you have an EMP(ID, NAME, SALARY) database table where ID is the primary key of the table. You also have an SQL table object that selects all columns from this table and you can edit the values through a table gadget. If you change the salary of an existing employee, the following can occur:

The parameters fetchedId, fetchedName, and fetchedSalary take the values that were initially obtained when the row was fetched.

As you can see, the second UPDATE statement above would fail if the salary of the employee has changed in the database since the row was fetched.

This technique is sometimes called "optimistic concurrency control". It is "optimistic" because it defers the locking of rows in the database until the update takes place. The advantage of this technique is that it maximizes the responsiveness of the database server and the degree of concurrency since it minimizes the number of row locks. The drawback is that the update can fail because of concurrent updates.

Another option is to set the concurrencyControl property to false and to use instead the refreshAndLockRow() method to acquire a lock on the row in the database. This technique is known as "pessimistic concurrency control" because it acquires locks much earlier and the locks remain in place a longer period of time if the end user has to type the updates after the lock was obtained but before the update takes place.

To summarize, in a situation where changes are performed:

[insertingNulls] For example, you have an EMP(ID, NAME, SALARY) database table where SALARY has a default value in the database. If you insert a row in this table without specifying the salary, the following can occur:

[usingBoundVariables] For example, you have an EMP(ID, NAME, SALARY). If you delete a row, then the following can occur:

[usingDynamicSQL] For example, you have an EMP(ID, NAME, SALARY). If you change the salary of an existing employee, the following can occur:

Method accessors

Name Return type Equivalent methods
cancelAsyncCall() Boolean cancelAsyncCall()
continueAsyncCall() Boolean continueAsyncCall()
getTableAlias(String name) Object TableAliases[name]
getTableAliasAt(Int index) Object TableAliases[index]
isInAsyncMode() Boolean isInAsyncMode()
isAsyncCallCompleted() Boolean isAsyncCallCompleted()

Constructor & Destructor Documentation

§ IliSQLTable() [1/3]

IliSQLTable::IliSQLTable ( IlvDisplay display)

Initializes an new SQL table.

Initially, the table definition is empty.

Parameters
displayThe display.

§ IliSQLTable() [2/3]

IliSQLTable::IliSQLTable ( const IliSQLTable source)

Copy constructor for the IliSQLTable class.

Parameters
sourceThe table that is copied to initialize this new object.

§ IliSQLTable() [3/3]

IliSQLTable::IliSQLTable ( IlvDisplay ,
IL_STDPREF istream &  input 
)

Initializes an SQL table by reading its definition from an input stream.

Parameters
inputThe input stream.

Member Function Documentation

§ addJoin() [1/2]

IlInt IliSQLTable::addJoin ( IlInt  tblNo1,
const IliAttributePath colName1,
IlInt  tblNo2,
const IliAttributePath colName2 
)

Adds a join.

Parameters
tblNo1The table position of the first table.
colName1The column name of the first table.
tblNo2The table position of the second table.
colName2The column name of the second table.
Returns
The position of the join.

§ addJoin() [2/2]

IlInt IliSQLTable::addJoin ( IlInt  tblNo1,
const char *  colName1,
IlInt  tblNo2,
const char *  colName2 
)

Adds a join.

Parameters
tblNo1The table position of the first table.
colName1The column name of the first table.
tblNo2The table position of the second table.
colName2The column name of the second table.
Returns
The position of the join.

§ addTable()

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).

Parameters
tblRefThe table.
Returns
The position of this table reference in the ordered set of table references.

§ addTableColumn()

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.

Parameters
tblDefThe table definition.
tblnoThe table position in the table definition.
colnoThe column position in the table definition.
Returns
The index of the newly created column or -1 if the column creation fails.

§ allowColumnMove()

virtual IlBoolean IliSQLTable::allowColumnMove ( ) const
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.

Returns
IlTrue if columns can be moved to this schema, and IlFalse otherwise.

Reimplemented from IliMemoryTable.

§ applyQueryMode()

virtual IlBoolean IliSQLTable::applyQueryMode ( IliTable queryTable)
virtual

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.

Parameters
queryTableThe table.
Returns
IlTrue if successful.

Reimplemented from IliTable.

§ cancelAsyncCall()

IlBoolean IliSQLTable::cancelAsyncCall ( )

Cancels all the asynchronous calls that are not completed.

Returns
IlTrue if successful.

§ clearRows()

virtual void IliSQLTable::clearRows ( )
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.

§ continueAsyncCall()

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.

Returns
IlTrue if the call is successful and IlFalse otherwise.

§ deleteConjunct()

void IliSQLTable::deleteConjunct ( IlInt  cno,
IlBoolean  wherePart 
)

Deletes a conjunct.

Parameters
cnoThe conjunct position.
wherePartIf IlTrue, deletes to the WHERE clause. If wherePart is IlFalse, the conjunct is deleted to the HAVING clause.

§ deleteJoin()

void IliSQLTable::deleteJoin ( IlInt  jno)

Deletes a join.

Parameters
jnoThe join position.

§ deleteRow()

virtual IlBoolean IliSQLTable::deleteRow ( IlInt  rowno)
virtual

Deletes a row.

Parameters
rownoThe row position.
Returns
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.

§ enableNoWaitOnLockRow()

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.

Parameters
nowaitIf IlTrue, "waiting on row locking" is enabled.

§ exchangeRows()

virtual IlBoolean IliSQLTable::exchangeRows ( IlInt  rowno1,
IlInt  rowno2 
)
virtual

Exchanges two rows.

Parameters
rowno1The first row position.
rowno2The second row position.
Returns
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.

§ fetchAll()

virtual IlInt IliSQLTable::fetchAll ( )
virtual

Fetches all remaining rows and stores them in the local row cache.

Returns
The number of rows effectively fetched.

Reimplemented from IliTable.

§ fetchCompleted()

virtual IlBoolean IliSQLTable::fetchCompleted ( ) const
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.

Returns
IlTrue, if all the rows have been fetched from the database and stored in the local row cache.

Reimplemented from IliTable.

§ fetchNext()

virtual IlInt IliSQLTable::fetchNext ( IlInt  count = 1)
virtual

Fetches up a number of rows from the database and stores them in the local row cache.

Parameters
countThe row count.
Returns
The number of rows effectively fetched.

Reimplemented from IliTable.

§ findJoin()

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.

Parameters
tblNo1The table position of the first table.
colName1The column name of the first table.
tblNo2The table position of the second table.
colName2The column name of the second table.
Returns
The position of the join whose definition or -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.

§ getAutoCommit()

IlBoolean IliSQLTable::getAutoCommit ( ) const

Indicates 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.

Returns
IlTrue if the SQL table is in auto-commit mode.

§ getAutoRefresh()

IlBoolean IliSQLTable::getAutoRefresh ( ) const

Indicates 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.

Returns
IlTrue if the SQL table is in auto-refresh mode.

§ getCache()

IliTable* IliSQLTable::getCache ( ) const

Returns the IliTable that manages the local row cache.

Initially, this property is 0.

Returns
The IliTable that manages the local row cache or 0 if the cache is managed by the IliSQLTable itself (through the IliMemoryTable class from which it inherits).

§ getCatalog() [1/2]

const IliSQLCatalog& IliSQLTable::getCatalog ( ) const

Returns the catalog of the SQL table.

A catalog is a set of database table definitions.

Returns
The catalog of the SQL table.

§ getCatalog() [2/2]

IliSQLCatalog& IliSQLTable::getCatalog ( )

Returns the catalog of the SQL table.

A catalog is a set of database table definitions.

Returns
The catalog of the SQL table.

§ getColumnDesignWidth()

IlInt IliSQLTable::getColumnDesignWidth ( IlInt  colno) const

Returns the design width, in pixels, of the column.

Parameters
colnoThe column position.
Returns
The design width, in pixels, of the column. This is the width of the column when it is shown in an IliSQLTable inspector.

§ getColumnOperation()

IliSQLOperation IliSQLTable::getColumnOperation ( IlInt  colno) const

Returns the operation requested for the column.

Parameters
colnoThe column position.
Returns
The operation requested for the column. The return value may be one of the following: IliSQLScalar, IliSQLGroupBy, IliSQLCount, IliSQLSum, IliSQLAvg, IliSQLMin, or IliSQLMax. The default is IliSQLScalar.

§ getColumnOrderBy()

IliSQLOrderByType IliSQLTable::getColumnOrderBy ( IlInt  colno) const

Returns the order requested for the column.

Parameters
colnoThe column position.
Returns
The order requested for the column. The return value may be one of the following: IliSQLNoOrder, IliSQLAscending or IliSQLDescending. The default is IliSQLNoOrder.

§ getColumnPredicat()

const char* IliSQLTable::getColumnPredicat ( IlInt  colno,
IlInt  cno,
IlBoolean  wherePart 
) const

Returns the predicate for the column in the conjunct.

Parameters
colnoThe column position.
cnoThe conjunct position.
wherePartIf IlTrue, from the WHERE clause, otherwise from the HAVING clause.
Returns
The predicate for the column.

§ getColumnSQLText()

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.

Parameters
colnoThe column position.
Returns
The text of the SQL expression used to retrieve the column.

§ getColumnTable()

IlInt IliSQLTable::getColumnTable ( IlInt  colno) const

Returns the position of the table reference that the column is mapped to.

The default is -1.

Parameters
colnoThe column position.
Returns
The position of the table reference that the column is mapped to, or -1 if this column is not directly mapped onto a table column.

§ getConcurrencyControl()

IlBoolean IliSQLTable::getConcurrencyControl ( ) const

Indicates if concurrency control is enabled for this 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.

Returns
IlTrue if concurrency control is enabled for the SQL table.

§ getConjunctsCount()

IlInt IliSQLTable::getConjunctsCount ( IlBoolean  wherePart) const

Returns the number of conjuncts defined for the SQL table.

Parameters
wherePartIf IlTrue, the conjuncts that constitute the WHERE clause are counted, whereas, if it is IlFalse, the conjuncts that constitute the HAVING clause are counted.
Returns
The number of conjuncts defined for the SQL table.

§ getCursorBufferedRowsCount()

IlInt IliSQLTable::getCursorBufferedRowsCount ( ) const

Returns the number of buffered rows.

Returns
The number of buffered rows. The value of this property is forwarded to any underlying SQL cursor used to select and fetch the result set of the SQL table (by calling its 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.

§ getEffectiveSQLSession()

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.

Returns
The effective SQL session object of the table.

§ getFetchPolicy()

IliFetchPolicy IliSQLTable::getFetchPolicy ( ) const

Returns the fetch policy of the SQL table.

The default for this property is IliFP_AsNeeded.

Returns
The fetch policy of the SQL table.

§ getJoin()

IlBoolean IliSQLTable::getJoin ( IlInt  jno,
IlInt tblNo1,
IliAttributePath colName1,
IlInt tblNo2,
IliAttributePath colName2 
) const

Returns the definition of the join.

Parameters
jnoThe join position.
tblNo1The table position of the first table.
colName1The column name of the first table.
tblNo2The table position of the second table.
colName2The column name of the second table.
Returns
IlTrue if successful.

§ getJoinIndex()

IlInt IliSQLTable::getJoinIndex ( IlInt  token) const

Returns the position of a join.

Parameters
tokenThe join token.
Returns
The position of a join or -1 if no such join exists.

§ getJoinsCount()

IlInt IliSQLTable::getJoinsCount ( ) const

Returns the number of joins that have been defined for the SQL table.

Returns
The number of joins that have been defined for the SQL table.

§ getJoinToken()

IlInt IliSQLTable::getJoinToken ( IlInt  jno) const

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).

Parameters
jnoThe join position.
Returns
The token of the join or -1 if no such join exists.

§ getJoinType()

IliSQLJoinType IliSQLTable::getJoinType ( IlInt  jno) const

Returns the type of the join.

Parameters
jnoThe join position.
Returns
The type of the join.

§ getQuery()

const char* IliSQLTable::getQuery ( ) const

Returns the SQL SELECT statement that will be used to query the database.

Returns
The SQL SELECT statement that will be used to query the database.

§ getQueryConjunct()

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.

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. This condition is combined with the WHERE part of the query, and with an AND Boolean operator. Initially, this property is set to the empty character string.

§ getRowsCount()

virtual IlInt IliSQLTable::getRowsCount ( ) const
virtual

Returns the number of rows in the table.

Returns
The count.

Reimplemented from IliMemoryTable.

§ getRowsCountLimit()

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.

Returns
The maximum number of rows that can be stored in the local memory cache.

§ getSQLSession()

IliSQLSession* IliSQLTable::getSQLSession ( ) const

Returns the SQL session object of the table.

Returns
The SQL session object of the table.

§ getTableAlias()

const char* IliSQLTable::getTableAlias ( IlInt  tblno) const

Returns the alias of one table.

Parameters
tblnoThe table reference position.
Returns
The alias.

§ getTableIndex() [1/2]

IlInt IliSQLTable::getTableIndex ( const char *  alias) const

Returns the position of the table reference.

Parameters
aliasThe table reference alias.
Returns
The position of the table reference or -1 if no such table reference exists.

§ getTableIndex() [2/2]

IlInt IliSQLTable::getTableIndex ( IlInt  token) const

Returns the index of the table reference.

Parameters
tokenThe table reference token.
Returns
The index of the table reference or -1 if no such table reference exists.

§ getTableParentDataSourceName()

const char* IliSQLTable::getTableParentDataSourceName ( IlInt  tblno) const

Returns the name of the parent data source for the table.

Parameters
tblnoThe table reference position.
Returns
The name of the parent data source for the table.

§ getTableParentPath()

IliAttributePath IliSQLTable::getTableParentPath ( IlInt  tblno) const

Returns the path to the nested table for the table.

Parameters
tblnoThe table reference position.
Returns
The path to the nested table for the table.

§ getTableParentRow()

IliRowPtr IliSQLTable::getTableParentRow ( IlInt  tblno) const

Returns the parent row for the table.

Parameters
tblnoThe table reference position.
Returns
The parent row for the table.

§ getTableParentSQLTable()

IliSQLTable* IliSQLTable::getTableParentSQLTable ( IlInt  tblno) const

Returns the parent SQL table for the table.

Parameters
tblnoThe table reference position.
Returns
The parent SQL table for the table.

§ getTableParentTableAlias()

const char* IliSQLTable::getTableParentTableAlias ( IlInt  tblno) const

Returns the alias of the database table that identifies the parent row.

Parameters
tblnoThe table reference position.
Returns
The alias of the database table that identifies the parent row.

§ getTableParentTableIndex()

IlInt IliSQLTable::getTableParentTableIndex ( IlInt  tblno) const

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.

Parameters
tblnoThe table reference position.
Returns
The index of the database table that identifies the parent row.

§ getTableRect()

IlvRect IliSQLTable::getTableRect ( IlInt  tblno) const

Returns the rectangle of the table reference.

This rectangle is only used at design time by the IliSQLTable inspector.

Parameters
tblnoThe table reference position.
Returns
The rectangle of the table reference.

§ getTableRef()

const IliSQLTableRef& IliSQLTable::getTableRef ( IlInt  tblno) const

Returns a table reference.

Parameters
tblnoThe table reference position.
Returns
The table reference.

§ getTablesCount()

IlInt IliSQLTable::getTablesCount ( ) const

Returns the number of tables in the "from" clause of the query.

Returns
The count.

§ getTableToken()

IlInt IliSQLTable::getTableToken ( IlInt  tblno) const

Returns the token of the table reference.

Parameters
tblnoThe table reference position.
Returns
The token of the table reference.

§ getValue()

virtual IlBoolean IliSQLTable::getValue ( IlInt  rowno,
IlInt  colno,
IliValue value 
) const
virtual

Returns a value.

This member function handles the fetching of the row (and all preceding rows) as necessary.

Parameters
rownoThe row position.
colnoThe column position.
valueThe value.
Returns
IlTrue if successful.

Reimplemented from IliMemoryTable.

§ insertConjunct()

void IliSQLTable::insertConjunct ( IlInt  cno,
IlBoolean  wherePart 
)

Adds a new conjunct.

Parameters
cnoThe conjunct position.
wherePartIf IlTrue, adds to the WHERE clause. If wherePart is IlFalse, the conjunct is added to the HAVING clause.

§ insertNulls()

void IliSQLTable::insertNulls ( IlBoolean  f)

Sets the insert-nulls mode for the SQL table.

Parameters
fIf IlTrue, the insert-nulls mode is on.

§ insertRow()

virtual IlBoolean IliSQLTable::insertRow ( IlInt  rowno,
IliTableBuffer buff 
)
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.

Parameters
rownoThe row position.
buffThe table buffer.
Returns
IlTrue if successful, and IlFalse if rowno is out of bounds, or if the row could not be inserted.

Reimplemented from IliMemoryTable.

§ isAsyncCallCompleted()

IlBoolean IliSQLTable::isAsyncCallCompleted ( ) const

Indicates if the last call to one of the asynchronous-enabled member functions (select(), fetchNext(), and fetchAll()) has completed.

Returns
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.

§ isColumnFetched()

IlBoolean IliSQLTable::isColumnFetched ( IlInt  colno) const

Indicates if the column should be part of the result computed by the query.

The default is IlTrue.

Parameters
colnoThe column position.
Returns
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.

§ isDistinct()

IlBoolean IliSQLTable::isDistinct ( ) const

Indicates 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.

Returns
IlTrue if the duplicate rows should be removed from the query result.

§ isInAsyncMode()

IlBoolean IliSQLTable::isInAsyncMode ( ) const

Indicates if the SQL table is in asynchronous mode.

Returns
IlTrue if the SQL table is in asynchronous mode. This occurs when the SQL session of the SQL table is itself in asynchronous mode.

§ isInsertingNulls()

IlBoolean IliSQLTable::isInsertingNulls ( ) const

Indicates if the SQL table includes any 0 columns when it constructs the INSERT SQL statement required to insert a row into a database.

When 0 columns are included, any default values defined in the table schema of the database are not taken into account, since a 0 value will be explicitly specified. On the other hand, when no default values are defined in the database, performance may be increased by including 0 columns. This is referred to as the insert-nulls mode. Initially, this property is set to IlTrue.

Returns
IlTrue if the SQL table includes any 0 columns when it constructs the INSERT SQL statement required to insert a row into a database.

§ isNoWaitOnLockRowEnabled()

IlBoolean IliSQLTable::isNoWaitOnLockRowEnabled ( ) const

The return value from this member function is only meaningful when the SQL session connects to an Oracle database server.

Returns
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.

§ isNoWaitOnLockRowSupported()

IlBoolean IliSQLTable::isNoWaitOnLockRowSupported ( ) const

Indicates if the enableNoWaitOnLockRow() member function is in effect.

Returns
IlTrue if the enableNoWaitOnLockRow() member function is in effect.

§ isQueryModeSupported()

virtual IlBoolean IliSQLTable::isQueryModeSupported ( ) const
virtual

Returns IlTrue if the table supports query mode.

Returns
IlTrue if the table supports query mode.

Reimplemented from IliTable.

§ isSelectDone()

virtual IlBoolean IliSQLTable::isSelectDone ( ) const
virtual

Returns IlTrue if the select() member function has been called since the object was constructed.

Returns
IlTrue if the select() member function has been called since the object was constructed.

Reimplemented from IliTable.

§ isTableUpdatable()

IlBoolean IliSQLTable::isTableUpdatable ( IlInt  tblno) const

Indicates if the table referenced at a given position can be updated through this SQL table object.

Parameters
tblnoThe table reference position.
Returns
IlTrue if the table referenced at position tblno can be updated through this SQL table object.

§ isUsingBoundVariables()

IlBoolean IliSQLTable::isUsingBoundVariables ( ) const

Indicates 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.

Returns
IlTrue if the bind-vars mode of the SQL table is enabled.

§ isUsingDynamicSQL()

IlBoolean IliSQLTable::isUsingDynamicSQL ( ) const

Indicates 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.

Returns
IlTrue if the SQL table is in dynamic-SQL mode.

§ makeQuery()

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.

Returns
IlTrue if successful.

§ makeQueryTable()

virtual IliTable* IliSQLTable::makeQueryTable ( ) const
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.

Returns
The table.

Reimplemented from IliTable.

§ moveRow()

virtual IlBoolean IliSQLTable::moveRow ( IlInt  from,
IlInt  to 
)
virtual

Moves a row.

Parameters
fromThe origin row position.
toThe destination row position.
Returns
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.

§ refreshAndLockRow()

virtual IlBoolean IliSQLTable::refreshAndLockRow ( IlInt  rowno)
virtual

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.

Parameters
rownoThe row position.
Returns
IlTrue if successful and IlFalse otherwise.

Reimplemented from IliTable.

§ refreshRow()

virtual IlBoolean IliSQLTable::refreshRow ( IlInt  rowno)
virtual

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.

Parameters
rownoThe row position.
Returns
IlTrue if successful and IlFalse otherwise.

Reimplemented from IliTable.

§ removeTable()

IlBoolean IliSQLTable::removeTable ( IlInt  tblno)

Removes a table reference.

Parameters
tblnoThe table reference position.
Returns
IlTrue if successful.

§ select()

virtual IlBoolean IliSQLTable::select ( )
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.

Returns
IlTrue if successful, and IlFalse otherwise.

Reimplemented from IliTable.

§ setAutoCommit()

void IliSQLTable::setAutoCommit ( IlBoolean  f)

Sets the auto-commit mode for the SQL table.

Parameters
fIf IlTrue, the auto-commit mode is on.

§ setAutoRefresh()

void IliSQLTable::setAutoRefresh ( IlBoolean  f)

Sets the auto-refresh mode for the SQL table.

Parameters
fIf IlTrue, the auto-refresh mode is on.

§ setCache()

void IliSQLTable::setCache ( IliTable cache)

Sets the IliTable used by the IliSQLTable to manage the local row cache.

Parameters
cacheIf 0, the IliSQLTable will manage the local row cache itself.

§ setColumnDesignWidth()

void IliSQLTable::setColumnDesignWidth ( IlInt  colno,
IlInt  width 
)

Sets the design width of the column.

Parameters
colnoThe column position.
widthThe width.

§ setColumnFetched()

virtual void IliSQLTable::setColumnFetched ( IlInt  colno,
IlBoolean  f 
)
virtual

Sets the fetched property of the column.

Parameters
colnoThe column position.
fIf IlTrue, the fetched property is on.

§ setColumnOperation()

virtual void IliSQLTable::setColumnOperation ( IlInt  colno,
IliSQLOperation  op 
)
virtual

Sets the operation requested for the column.

Parameters
colnoThe column position.
opThe operation.

§ setColumnOrderBy()

virtual void IliSQLTable::setColumnOrderBy ( IlInt  colno,
IliSQLOrderByType  order 
)
virtual

Sets the order requested for the column.

Parameters
colnoThe column position.
orderThe order requested for the column.

§ setColumnPredicat()

void IliSQLTable::setColumnPredicat ( IlInt  colno,
IlInt  cno,
const char *  predicat,
IlBoolean  wherePart 
)

Sets the predicate of the column in the conjunct.

Parameters
colnoThe column position.
cnoThe conjunct position
predicatThe predicate.
wherePartIf IlTrue, from the WHERE clause, otherwise from the HAVING clause.

§ setColumnSQLText()

virtual void IliSQLTable::setColumnSQLText ( IlInt  colno,
const char *  text 
)
virtual

Sets the SQL text of the column.

Parameters
colnoThe column position.
textThe SQL text, that is copied.

§ setColumnTable()

virtual void IliSQLTable::setColumnTable ( IlInt  colno,
IlInt  tblno 
)
virtual

Sets the table reference onto which the column should be mapped.

Parameters
colnoThe column position.
tblnoThe table position or -1 if the column is not directly mapped onto a table column.

§ setConcurrencyControl()

void IliSQLTable::setConcurrencyControl ( IlBoolean  cc)

Enables or disables concurrency control for the SQL table.

Parameters
ccIf IlTrue, enables concurrency control for the SQL table.

§ setCursorBufferedRowsCount()

void IliSQLTable::setCursorBufferedRowsCount ( IlInt  count)

Sets the number of buffered rows to count.

Parameters
countThe count.

§ setDistinct()

void IliSQLTable::setDistinct ( IlBoolean  f)

Sets the distinct property of the SQL table.

Parameters
fIf IlTrue, the distinct property is on.

§ setFetchPolicy()

void IliSQLTable::setFetchPolicy ( IliFetchPolicy  fp)

Sets the fetch policy of the SQL table.

Parameters
fpThe 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.

§ setJoinType()

void IliSQLTable::setJoinType ( IlInt  jno,
IliSQLJoinType  type 
)

Sets the type of the join.

Parameters
jnoThe join position.
typeThe join type.

§ setQuery()

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.

Parameters
queryThe query.

§ setQueryConjunct()

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.

Parameters
conditionThe condition.

§ setQueryFrom()

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.

Parameters
tblRefThe database table.
Returns
IlTrue if successful and IlFalse otherwise.

§ setRowsCountLimit()

void IliSQLTable::setRowsCountLimit ( IlInt  size)

Sets the rows count limit of the SQL table.

Parameters
sizeThe maximum size.

§ setSQLSession()

void IliSQLTable::setSQLSession ( IliSQLSession session)

Sets the SQL session object of the table.

Parameters
sessionThe SQL session.

§ setTableParentDataSourceName()

void IliSQLTable::setTableParentDataSourceName ( IlInt  tblno,
const char *  name 
)

Sets the name of the parent data source for the table.

Parameters
tblnoThe table reference position.
nameThe data source name.

§ setTableParentPath()

void IliSQLTable::setTableParentPath ( IlInt  tblno,
const IliAttributePath path 
)

Sets the path to the nested table for the table.

Parameters
tblnoThe table reference position.
pathThe path.

§ setTableParentRow()

void IliSQLTable::setTableParentRow ( IlInt  tblno,
const IliRowPtr row 
)

Sets the parent row for the table.

Parameters
tblnoThe table reference position.
rowThe parent row.

§ setTableParentSQLTable()

void IliSQLTable::setTableParentSQLTable ( IlInt  tblno,
IliSQLTable sqlTbl 
)

Sets the parent SQL table for the table.

Parameters
tblnoThe table reference position.
sqlTblThe SQL table.

§ setTableParentTableAlias()

void IliSQLTable::setTableParentTableAlias ( IlInt  tblno,
const char *  name 
)

Sets the alias of the database table that identifies the parent row.

Parameters
tblnoThe table reference position.
nameThe alias, it should belong to the parent SQL table.

§ setTableRect()

void IliSQLTable::setTableRect ( IlInt  tblno,
const IlvRect rect 
)

Sets the rectangle of the table reference.

Parameters
tblnoThe table reference position.
rectThe rectangle.

§ setTableRef()

void IliSQLTable::setTableRef ( IlInt  tblno,
const IliSQLTableRef tblRef 
)

Replaces a table reference.

Parameters
tblnoThe table reference position.
tblRefThe new table reference.

§ setTableUpdatable()

void IliSQLTable::setTableUpdatable ( IlInt  tblno,
IlBoolean  flag 
)

Changes the updatable property of the table reference.

Parameters
tblnoThe table reference position.
flagIf IlTrue, the table is updatable.

§ updateRow()

virtual IlBoolean IliSQLTable::updateRow ( IlInt  rowno,
IliTableBuffer buff 
)
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.

Parameters
rownoThe row position.
buffThe table buffer.
Returns
IlTrue if successful and IlFalse if rowno is out of bounds, or if the row could not be updated.

Reimplemented from IliMemoryTable.

§ useBoundVariables()

void IliSQLTable::useBoundVariables ( IlBoolean  f)

Sets the bind-vars mode of the SQL table.

Parameters
fIf IlTrue, the bind-vars mode is on.

§ useDynamicSQL()

void IliSQLTable::useDynamicSQL ( IlBoolean  f)

Sets the dynamic-SQL mode for the SQL table.

Parameters
fIf IlTrue, the dynamic-SQL mode is on.

§ write()

virtual void IliSQLTable::write ( std::ostream &  output) const
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.

Parameters
outputThe output stream.

© Copyright 2018, 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.