Inherited by AggTableImpl, and TableImpl.
Public Member Functions | |
| virtual void | setCondition (Condition *c)=0 |
| sets condition for the select, update and delete operations | |
| virtual DbRetVal | bindFld (const char *name, void *val)=0 |
| binds application buffer to the specified field of the table. | |
| virtual void | markFldNull (const char *name)=0 |
| marks the specified field to insert null when insert method is called. | |
| virtual void | markFldNull (int colpos)=0 |
| marks the specified field to insert null when insert method is called. | |
| virtual void | clearFldNull (const char *name)=0 |
| clears the null mark which is set before. | |
| virtual void | clearFldNull (int colpos)=0 |
| clears the null mark which is set before. | |
| virtual bool | isFldNull (const char *name)=0 |
| checks whether the field value is null. | |
| virtual bool | isFldNull (int colpos)=0 |
| checks whether the field value is null for the specified field position. | |
| virtual DbRetVal | execute ()=0 |
| executes the select statement. | |
| virtual DbRetVal | insertTuple ()=0 |
| insert the tuple into the table. | |
| virtual DbRetVal | updateTuple ()=0 |
| update values in the current tuple of the table. | |
| virtual DbRetVal | deleteTuple ()=0 |
| deletes the current tuple of the table. | |
| virtual int | deleteWhere ()=0 |
| deletes all the records which satisfies the condition set. | |
| virtual int | truncate ()=0 |
| deletes the all the records in the table. | |
| virtual void * | fetch ()=0 |
| fetches the next tuple in the table which satisfies the condition specified. | |
| virtual void * | fetchNoBind ()=0 |
| fetches the next tuple in the table which satisfies the condition specified. | |
| virtual DbRetVal | close ()=0 |
| closes the scan. | |
| virtual long | spaceUsed ()=0 |
| Retrieves the total space used for this table in bytes. | |
| virtual long | numTuples ()=0 |
| Retrieves the total number of tuples present in this table. | |
| virtual DbRetVal | lock (bool shared)=0 |
| takes lock on the table if bool shared flag is set, it will take shared lock, or else exclusive lock | |
| virtual DbRetVal | unlock ()=0 |
| releases the lock acquired on the table | |
| virtual DbRetVal | setUndoLogging (bool flag)=0 |
| sets the undo log flag. | |
Table is a set of data values organized using a model of horizontal rows and columns.
Columns are identified by name and rows by values. It shall be visualized as a linked
list of related data
Functionality:
1.insert
2.update
3.delete
4.select with predicate or condition
| virtual DbRetVal Table::bindFld | ( | const char * | name, | |
| void * | val | |||
| ) | [pure virtual] |
binds application buffer to the specified field of the table.
Before doing any DML operations required fields are binded first. Below are the candidates for this:
1.All the fields in the projection list of select statement.
2.Field list in the insert statement.
3.Fields in the assignment list of update statement.
| name | field name in the table | |
| val | address of the application buffer. Memory should be allocated by the application before binding the buffer. |
| virtual void Table::clearFldNull | ( | int | colpos | ) | [pure virtual] |
clears the null mark which is set before.
| colpos | field position |
| virtual void Table::clearFldNull | ( | const char * | name | ) | [pure virtual] |
clears the null mark which is set before.
| name | field name |
| virtual DbRetVal Table::close | ( | ) | [pure virtual] |
closes the scan.
Needs to be called before calling execute again on the same table handle. It releases the resources acquired during the scan.
| virtual DbRetVal Table::deleteTuple | ( | ) | [pure virtual] |
deletes the current tuple of the table.
It works only on top of select. using fetch first go to the tuple to be deleted, then call this method to delete.
To delete all the tuples, do not set any condition and call fetch followed by delete in a loop till fetch exhausts.
| virtual int Table::deleteWhere | ( | ) | [pure virtual] |
deletes all the records which satisfies the condition set.
| virtual DbRetVal Table::execute | ( | ) | [pure virtual] |
executes the select statement.
Based on the predicate(condition), respective index is chosen for the select. Application should call execute before they start fetching the values from the table.This starts scan on the table.
| virtual void* Table::fetch | ( | ) | [pure virtual] |
fetches the next tuple in the table which satisfies the condition specified.
execute should be called before calling this method. Application buffer should be binded to get the tuple values.
| virtual void* Table::fetchNoBind | ( | ) | [pure virtual] |
fetches the next tuple in the table which satisfies the condition specified.
execute should be called before calling this method. Application buffer need not be binded to call this method.
| virtual DbRetVal Table::insertTuple | ( | ) | [pure virtual] |
insert the tuple into the table.
Prior to this, the binded buffer should be updated Values present in the binded buffers of all the fields are taken and stored in the table.
| virtual bool Table::isFldNull | ( | int | colpos | ) | [pure virtual] |
checks whether the field value is null for the specified field position.
| colpos | field position |
| virtual bool Table::isFldNull | ( | const char * | name | ) | [pure virtual] |
checks whether the field value is null.
| name | field name |
| virtual DbRetVal Table::lock | ( | bool | shared | ) | [pure virtual] |
takes lock on the table if bool shared flag is set, it will take shared lock, or else exclusive lock
| virtual void Table::markFldNull | ( | int | colpos | ) | [pure virtual] |
marks the specified field to insert null when insert method is called.
| colpos | field position |
| virtual void Table::markFldNull | ( | const char * | name | ) | [pure virtual] |
marks the specified field to insert null when insert method is called.
| name | field name in the table |
| virtual long Table::numTuples | ( | ) | [pure virtual] |
| virtual void Table::setCondition | ( | Condition * | c | ) | [pure virtual] |
sets condition for the select, update and delete operations
| c | condition |
| virtual DbRetVal Table::setUndoLogging | ( | bool | flag | ) | [pure virtual] |
| virtual long Table::spaceUsed | ( | ) | [pure virtual] |
| virtual int Table::truncate | ( | ) | [pure virtual] |
deletes the all the records in the table.
No transaction required to call this. It takes table level lock.
| virtual DbRetVal Table::unlock | ( | ) | [pure virtual] |
| virtual DbRetVal Table::updateTuple | ( | ) | [pure virtual] |
update values in the current tuple of the table.
It works only on top of select using fetch go to the tuple to be updated, then update the binded buffer value and then call this method to updates the field values in the tuple.