ISAM Access and the IsamFile Class

Overview

CQL++ allows access to tables at the ISAM level. Tables which are created by an SQL CREATE statement may be accessed at the ISAM. Tables which are created at the ISAM level are now known to the SQL level, because no entry exists for the table in the SQL main dictionary.

ISAM level access is implemented by the IsamFile class. In addition, a connection handle is required. This can be an instance of class SqlHandle used for SQL level access, or an instance of class DatabaseHandle. If accessing tables at both the ISAM and SQL levels, class SqlHandle must be used. If accessing tables at only the ISAM level, either handle class may be used.

The manual pages in this chapter describe each IsamFile member function. Before using these manual pages, read the Introduction section. Many of the available ISAM operations required a series of functions, and the manual page for an individual function may be difficult to understand unless the sequence in which that function is used is familiar to the reader.

The AbstractTable Class

Functions DatabaseHandle::Open and DatabaseHandle::BeginCreate refer to class AbstractTable instead of IsamFile. Internally, most functions are virtual functions referencing base class AbstractTable. This facilitates interfacing the SQL level to other low level file systems. Unless you are integrating another low level file system, AbstractTable will also be instantiated as IsamFile.

Creating ISAM Tables

An ISAM table is created using the following sequence of IsamFile member function calls:

There is one call to AddColumn for each column in the ISAM table. In the key specification sequence, there is one call to AddSegment for each key segment. Every key has at least one segment, which corresponds to one of the table's columns. For example, a table might contain names and addresses. A typical way to index such a table is to index by last name. A column would be specified for the last name, and an index would be created with one segment consisting of the last name. A key which uses more than one column is referred to as a segmented key. For example, you may have a column for the last name, and a column for the first name. To index by the last name plus the first name, you create a key with two segments. You may create as many keys as necessary for a table. For example, you might want to index your name list by name as well as by ZIP code. To do so you would create two keys.

Here is an example of creating an ISAM table with one single segment key. This table has four columns, all type character. The first is the last name (length 20), the second is the first name (length 20), the third is the telephone number (length 15), and the fourth is the ZIP code (length 10).

pIsamFile isamTable;
DatabaseHandle handle;

if( handle.BeginTransaction() == CQL_FAILURE )
	//  some error action

if( handle.BeginCreate( &isamTable, "TEST1" ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 20 ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 20 ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 15 ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 10 ) == CQL_FAILURE )
	//  some error action

if( isamTable->BeginKey() == CQL_FAILURE )
	//  some error action

if( isamTable->AddSegment( 0 ) == CQL_FAILURE )
	//  some error action

if( isamTable->EndKey() == CQL_FAILURE )
	//  some error action

if( isamTable->EndCreate() == CQL_FAILURE )
	//  some error action

if( handle.EndTransaction() == CQL_FAILURE )
	//  some error action
This statement creates the same table, but with one key on last name + first name, and a second key on the zip code.
pIsamFile isamTable;
DatabaseHandle handle;

if( handle.BeginTransaction() == CQL_FAILURE )
	//  some error action

if( handle.BeginCreate( &isamTable, "TEST1" ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 20 ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 20 ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 15 ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddColumn( CQL_CHAR, 10 ) == CQL_FAILURE )
	//  some error action

if( isamTable->BeginKey() == CQL_FAILURE )
	//  some error action

if( isamTable->AddSegment( 0 ) == CQL_FAILURE )
	//  some error action

if( isamTable->AddSegment( 1 ) == CQL_FAILURE )
	//  some error action

if( isamTable->EndKey() == CQL_FAILURE )
	//  some error action

if( isamTable->BeginKey() == CQL_FAILURE )
	//  some error action

if( isamTable->AddSegment( 3 ) == CQL_FAILURE )
	//  some error action

if( isamTable->EndKey() == CQL_FAILURE )
	//  some error action

if( isamTable->EndCreate() == CQL_FAILURE )
	//  some error action

if( handle.EndTransaction() == CQL_FAILURE )
	//  some error action
Note that the ISAM layer is not aware of the SQL column names corresponding to the ISAM table columns. The ISAM layer knows them only as a column number (0, 1, 2, ...) accompanied by a length and type. The possible type values are listed on the manual page for the AddColumn function. Note also that the ISAM table operation is part of a transaction, and must be committed. If the create is not committed, the table will be deleted the next time the CQL++ system starts.

The creates in the two preceding examples create keys which allow duplicates. Keys can also be created which do not allow duplicates. Refer to the manual page for BeginKey for more information.

Opening and Closing ISAM Tables

Functions DatabaseHandle::OpenAbstractTable and Close are used to open and close an ISAM table. For example:
DatabaseHandle handle;
pIsamFile isamTable;

if( handle.Open( &isamTable, "TEST1" ) == CQL_FAILURE )
	//  some error action

if( isamTable->Close() == CQL_FAILURE )
	//  some error action
Adding Data Data is added to an ISAM table using the following sequence of IsamFile member function calls:

AddRow must be preceded by at least one SetColumn call. A column whose value has not been specified at AddRow time defaults to NULL\footnote{Keep in mind that the data value NULL, which means "not known", is not the same as the C value NULL which is usually zero.}

The following code fragment adds a row to the table created in earlier in this section.

IsamFile isamTable;
char lastName[ 30 ];
char firstName[ 30 ];

memset( lastName, 0, sizeof( name ) );
strcpy( lastName, "Jones" );
memset( firstName, 0, sizeof( firstName ) );
strcpy( firstName, "James" );

if( handle.BeginTransaction() == CQL_FAILURE )
	//  some error action

if( isamTable.BeginRowOperation() == CQL_FAILURE )
	//  some error action

if( isamTable.SetColumn( ((unsigned char *)lastName) ) == CQL_FAILURE )
	//  some error action

if( isamTable.SetColumn( ((unsigned char *)firstName) ) == CQL_FAILURE )
	//  some error action

if( isamTable.AddRow() == CQL_FAILURE )
	//  some error action

if( handle.CommitTransaction() == CQL_FAILURE )
	//  some error action

Finding Rows

There are several functions used to find a row in an ISAM table. There are two classes of functions for finding data. One class finds data in a sequence controlled by one of the table's keys, but does not specify a key. These are the functions which find the first or last row, or the previous or next row. The second class finds a row based on its relationship to a key (equal, less than, etc.).

All functions which find data begin with a call to BeginIsamOperation, which selects one of the table's keys. For functions which use an input key, column specification calls follow. The find sequence terminates with one of the Find calls.

The find functions which do not use an input key are:

The find functions which use an input key are:

In addition, two functions uses a partial key. A partial key consists on one or more columns of a multi-segment key.

The following example finds the first row in an ISAM table, using the first key.

IsamFile isamTable;
int result;

//  0 means key \#0
if( isamTable.BeginIsamOperation( 0 ) == CQL_FAILURE )
	//  some error action

if( isamTable.FirstRow( \&result ) == CQL_FAILURE )
	//  some error action

if( result == CQL_YES )
	cout << "first row found\n";
else
	cout << "no rows in table\n";
The following example finds a row in an ISAM table whose first column has the value "Smith". This assumes that table key 0 is a single segment key on the first column.
IsamFile isamTable;
int result;

if( isamTable.BeginIsamOperation( 0 ) == CQL_FAILURE )
	//  some error action

if( isamTable.SetColumn( "Smith" ) == CQL_FAILURE )
	//  some error action

if( isamTable.FindEqual( \&result ) == CQL_FAILURE )
	//  some error action

if( result == CQL_YES )
	cout << "row found\n";
else
	cout << "row not found\n";
The following example finds the first row in an ISAM table whose ZIP code is greater than or equal to "11111". This example uses the ISAM table created by the second example earlier in this section. Recall that this table has two keys. The second key is a single segment key on the ZIP code.
IsamFile isamTable;
int result;

if( isamTable.BeginIsamOperation( 1 ) == CQL_FAILURE )
	//  some error action

if( isamTable.SetColumn( "11111", 3 ) == CQL_FAILURE )
	//  some error action

if( isamTable.FindGreaterOrEqual( \&result ) == CQL_FAILURE )
	//  some error action

if( result == CQL_YES )
	cout << "row found\n";
else
	cout << "row not found\n";
The BeginIsamOperation call references key 1, the table's second key. The SetColumn call uses a second parameter, which specifies the column number of the data being set. In the preceding examples, it has not been necessary to specify the column number because we are specifying the values in sequence. In this case, we wish to specify column 3 without specifying columns 0, 1, and 2, so we use the alternate form of SetColumn.

Retrieving Column Data

The functions described in the preceding section leave the ISAM table positioned at a row. Whenever the ISAM table has a current position, row data can be retrieved using one of the GetColumn functions. These functions are:

Manual Pages

This section provides a description for each IsamFile member function in a format similar to the UNIX max page format. All functions return a status, either CQL_SUCCESS or one of the other API return codes. SqlHandle::Error can be used to obtain more information about an error which occurs when one of the IsamFile methods is executed. The following functions are described:
IsamFile::AddColumn
IsamFile::AddRow
IsamFile::AddSegment
DatabaseHandle::BeginCreate
IsamFile::BeginIsamOperation
IsamFile::BeginKey
IsamFile::BeginRowOperation
IsamFile::CheckPropagationFlags
IsamFile::Close
IsamFile::Columns
IsamFile::CurrentKey
IsamFile::CurrentPosition
IsamFile::CurrentRecord
DecrementTransactionCounter
IsamFile::DeleteCurrentRecord
IsamFile::DeleteIndexMember
IsamFile::DeleteRow
IsamFile::DestroyIndexIndex
IsamFile::DestroyIsamIndex
IsamFile::EndCreate
IsamFile::EndKey
IsamFile::EstablishPosition
IsamFile::File
IsamFile::FileExists
IsamFile::FindEqual
IsamFile::FindFirstPartialKeyMatch
IsamFile::FindGreater
IsamFile::FindGreaterOrEqual
IsamFile::FindLess
IsamFile::FindLessOrEqual
IsamFile::FindNextPartialKeyMatch
IsamFile::FirstRow
IsamFile::FlushDataToRecord
IsamFile::GetColumnLength
IsamFile::GetColumnPointer
IsamFile::GetColumnValue
IsamFile::GetColumnInfo
IsamFile::GetColumnInfoCurrentSetting
IsamFile::IncrementTransactionCounter
IsamFile::IndexAddress
IsamFile::LastRow
IsamFile::NextRow
IsamFile::NumberOfEntriesEqualToKey
IsamFile::NumberOfEntriesGreaterOrEqualToKey
IsamFile::NumberOfEntriesGreaterThanKey
IsamFile::NumberOfEntriesLessOrEqualToKey
IsamFile::NumberOfEntriesLessThanKey
DatabaseHandle::Open
IsamFile::PreviousRow
IsamFile::RollbackDirtyRecords
IsamFile::SetColumn
IsamFile::SetDataFetched
IsamFile::TransactionCounter
IsamFile::UpdateRow

IsamFile::AddColumn

NAME
IsamFile::AddColumn
SYNOPSIS
NI IsamFile::AddColumn( CqlColumnTypes type, UL len )
DESCRIPTION
AddColumn is used to specify a column during the ISAM create process.
SEE ALSO
  • IsamFile::BeginCreate
  • IsamFile::BeginKey
  • IsamFile::AddSegment
  • IsamFile::EndKey
  • IsamFile::EndCreate
IsamFile::AddRow
NAME
IsamFile::AddRow
SYNOPSIS
NI IsamFile::AddRow( VOID )
DESCRIPTION
AddRow is the last step in the sequence to add a row to an ISAM file.
SEE ALSO
  • IsamFile::BeginRowOperation
  • IsamFile::SetColumn

IsamFile::AddSegment

NAME
IsamFile::AddSegment
SYNOPSIS
NI IsamFile::AddSegment( US columnNumber, NI descending = CQL_NO )
DESCRIPTION
AddSegment is part of the create sequence, and adds a segment to a key.
SEE ALSO
  • IsamFile::BeginCreate
  • IsamFile::AddColumn
  • IsamFile::BeginKey
  • IsamFile::EndKey
  • IsamFile::EndCreate
DatabaseHandle::BeginCreate
NAME
DatabaseHandle::BeginCreate
SYNOPSIS
NI DatabaseHandle::BeginCreate(
    pAbstractTable* isamTable,
    pNC name,
    NI temporary = CQL_NO,
    NI tableType = CQL_CQL
)
DESCRIPTION
BeginCreate is the first step in the ISAM table creation sequence. name is table name. Two files are created for the table, name.data and name.index. If temporary is CQL_YES, the table exists only in memory and nothing is written to disk. The tableType argument is included for interfacing the SQL level to other ISAM level file systems; it is always CQL_CQL.
SEE ALSO
  • IsamFile::AddColumn
  • IsamFile::BeginKey
  • IsamFile::AddSegment
  • IsamFile::EndKey
  • IsamFile::EndCreate

IsamFile::BeginIsamOperation

NAME
IsamFile::BeginIsamOperation
SYNOPSIS
NI IsamFile::BeginIsamOperation( US keyNumber )
DESCRIPTION
BeginIsamOperation is used to start an ISAM search operation. It is followed by one or more SetColumn calls. Finally, one of the Find calls completes the search operation.
SEE ALSO
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindGreater
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow
  • IsamFile::DeleteRow

IsamFile::BeginKey

NAME
IsamFile::BeginKey
SYNOPSIS
NI IsamFile::BeginKey( NI denyDuplicates = CQL_NO )
DESCRIPTION
BeginKey is used to start specification of a key as part of the ISAM table creation sequence. If denyDuplicates is CQL_YES, duplicate values are not permitted for the key.
SEE ALSO
  • IsamFile::AddSegment
  • IsamFile::BeginCreate
  • IsamFile::AddColumne
  • IsamFile::EndKey
  • IsamFile::EndCreate

IsamFile::BeginRowOperation

NAME
IsamFile::BeginRowOperation
SYNOPSIS
NI IsamFile::BeginRowOperation( VOID )
DESCRIPTION
BeginRowOperation initializes all column values to null. It is the first step in the sequence which adds a row to an ISAM table. After one or more calls to SetColumn, the sequence ends with AddRow.
SEE ALSO
  • IsamFile::SetColumn
  • IsamFile::AddRow

Isamfile::CheckPropagationFlags

NAME
IsamFile::CheckPropagationFlags
SYNOPSIS
NI CheckPropagationFlags( VOID )
DESCRIPTION
CheckPropagationFlags is called to check an ISAM file's propagation flags after a nested transaction commit. CQL++ never writes committed information unless an outermost commit occurs. The propagation flags are necessary when a commit is the outermost commit for the ISAM table, but is not the outermost commit for the transaction. In this case, the ISAM table and ISAM index must be added to the lists of active tables and active indices for the current transaction. This operation is performed, if necessary, by CheckPropagationFlags.

IsamFile::Close

NAME
IsamFile::Close
SYNOPSIS
NI IsamFile::Close( VOID )
DESCRIPTION
Close closes an ISAM table and releases associated resources. If there are pending transaction for the table, and error is returned and the table is not closed.
SEE ALSO
  • IsamFile::Open

IsamFile::Columns

NAME
IsamFile::Columns
SYNOPSIS
NI IsamFile::Columns( pColumnDescriptorList *cols )
DESCRIPTION
Columns retrieves a pointer to the list of columns for an open ISAM table.

IsamFile::CurrentKey

NAME
IsamFile::CurrentKey
SYNOPSIS
pIsamKeyDescriptor CurrentKey( VOID )
DESCRIPTION
CurrentKey returns a pointer to the IsamKeyDescriptor class for the current key.

IsamFile::CurrentPosition

NAME
IsamFile::CurrentPosition
SYNOPSIS
NI CurrentPosition( pRECID position )
DESCRIPTION
CurrentPosition returns the ISAM table's current position. Prior to calling CurrentPosition, a valid position must be established using a search sequence.
SEE ALSO
  • IsamFile::EstablishPosition
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindGreater
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow

IsamFile::CurrentRecord

NAME
IsamFile::CurrentPosition
SYNOPSIS
pRecord CurrentRecord( VOID )
DESCRIPTION
CurrentRecord returns a pointer to the Record class for the ISAM table's current record. Prior to calling CurrentRecord, a valid position must be established using a search sequence.

IsamFile::DecrementTransactionCounter

NAME
IsamFile::DecrementTransactionCounter
SYNOPSIS
VOID DecrementTransactionCounter( VOID )
DESCRIPTION
DecrementTransactionCounter decrements a counter used to keep track of the number of nested transactions an ISAM table is involved in. The counter is used to identify the outermost transaction for an ISAM table.

IsamFile::DeleteCurrentRecord

NAME
IsamFile::DeleteCurrentRecord
SYNOPSIS
NI DeleteCurrentRecord( VOID )
DESCRIPTION
DeleteCurrentRecord deletes the current row of an ISAM table. A current row must first be established with one of the Find functions.

IsamFile::DeleteIndexMember

NAME
IsamFile::DeleteIndexMember
SYNOPSIS
NI DeleteIndexMember( VOID )
DESCRIPTION
DeleteIndexMember deletes one of the keys of an index associated with an ISAM table.

IsamFile::DeleteRow

NAME
IsamFile::DeleteRow
SYNOPSIS
NI IsamFile::DeleteRow( VOID )
DESCRIPTION
DeleteRow deletes the current row from an ISAM table. Before DeleteRow is called, a valid current position must be established using one of the search sequences.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindGreater
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow

IsamFile::DestroyIndexIndex

NAME
IsamFile::DestroyIndexIndex
SYNOPSIS
NI DestroyIndexIndex( VOID )
DESRIPTION
DestroyIndexIndex cleans up a temporary index used during ISAM table processing.

IsamFile::DestroyIsamIndex

NAME
IsamFile::DestroyIsamIndex
SYNOPSIS
NI DestroyIsamIndex( VOID )
DESRIPTION
DestroyIsamIndex cleans up a temporary index used during ISAM table processing.

IsamFile::EndCreate

NAME
IsamFile::EndCreate
SYNOPSIS
NI IsamFile::EndCreate( VOID )
DESCRIPTION
EndCreate completes the ISAM table creation sequence.
SEE ALSO
  • DatabaseHandle::BeginCreate
  • IsamFile::AddColumn
  • IsamFile::BeginKey
  • IsamFile::AddSegment
  • IsamFile::EndKey

IsamFile::EndKey

NAME
IsamFile::EndKey
SYNOPSIS
NI IsamFile::EndKey( VOID )
DESCRIPTION
EndKey completes the key specification sequence within the ISAM table creation sequence.
SEE ALSO
  • IsamFile::BeginCreate
  • IsamFile::BeginKey
  • IsamFile::AddSegment
  • IsamFile::AddColumn
  • IsamFile::EndCreate

IsamFile::EstablishPosition

NAME
IsamFile::EstablishPosition
SYNOPSIS
NI IsamFile::EstablishPosition( RECID position, US keyNumber )
DESCRIPTION
EstablishPosition is used to establish the current position at location position for key keyNumber. The position value is obtained by an earlier call to CurrentPosition.
SEE ALSO
  • IsamFile::CurrentPosition

IsamFile::File

NAME
IsamFile::File
SYNOPSIS
pFileManager IsamFile::File( VOID )
DESCRIPTION
File returns the pointer to the FileManager class associated with the open ISAM table.

IsamFile::FileExists

NAME
IsamFile::FileExists
SYNOPSIS
NI FileExists( pNI result, pNC name )
DESCRIPTION
FileExists checks whether an ISAM table with name name exists.

IsamFile::FindEqual

NAME
IsamFile::FindEqual
SYNOPSIS
NI FindEqual( pNI result )
DESCRIPTION
FindEqual is the last operation in a search sequence to find a row equal to a supplied key value. The sequence begins with BeginIsamOperation, which specifies which key to use. One call to SetColumn is made for each segment of the key. FindEqual then completes the sequence. If a matching row is found, CQL_YES is written to *result. If no matching row is found, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindGreater
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow

IsamFile::FindFirstPartialKeyMatch

NAME
IsamFile::FindFirstPartialKeyMatch
SYNOPSIS
NI IsamFile::FindFirstPartialKeyMatch( pNI result )
DESCRIPTION
FindFirstPartialKeyMatch completes the sequence for finding a row matching a partially supplied key. The sequence begins with BeginIsamOperation, which specifies which key to use. This is followed by at least one call to SetColumn. This function requires only a partial key, and therefore it is not necessary to call SetColumn for each key segment. If a matching row is found, CQL_YES is written to *result. If no matching row is found, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindGreater
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow

IsamFile::FindGreater

NAME
IsamFile::FindGreater
SYNOPSIS
NI IsamFile::FindGreater( pNI result )
DESCRIPTION
FindGreater is the last operation in a search sequence to find a row greater than a supplied key value. The sequence begins with BeginIsamOperation, which specifies which key to use. One call to SetColumn is made for each segment of the key. FindGreater then completes the sequence. If a matching row is found, CQL_YES is written to *result. If no matching row is found, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindNextPartialKeyMatch

IsamFile::FindGreaterOrEqual

NAME
IsamFile::FindGreaterOrEqual
SYNOPSIS
NI IsamFile::FindGreaterOrEqual( pNI result )
DESCRIPTION
FindGreaterOrEqual is the last operation in a search sequence to find a row greater than or equal to a supplied key value. The sequence begins with BeginIsamOperation, which specifies which key to use. One call to SetColumn is made for each segment of the key. FindGreaterOrEqual then completes the sequence. If a matching row is found, CQL_YES is written to *result. If no matching row is found, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindGreater
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindNextPartialKeyMatch

IsamFile::FindLess

NAME
IsamFile::FindLess
SYNOPSIS
NI IsamFile::FindLess( pNI result )
DESCRIPTION
FindLess is the last operation in a search sequence to find a row less than a supplied key value. The sequence begins with BeginIsamOperation, which specifies which key to use. One call to SetColumn is made for each segment of the key. FindLess then completes the sequence. If a matching row is found, CQL_YES is written to *result. If no matching row is found, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindGreater
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindNextPartialKeyMatch

IsamFile::FindLessOrEqual

NAME
IsamFile::FindLessOrEqual
SYNOPSIS
NI IsamFile::FindLessOrEqual( pNI result )
DESCRIPTION
FindLessOrEqual is the last operation in a search sequence to find a row less than or equal to a supplied key value. The sequence begins with BeginIsamOperation, which specifies which key to use. One call to SetColumn is made for each segment of the key. FindLessOrEqual then completes the sequence. If a matching row is found, CQL_YES is written to *result. If no matching row is found, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindGreater
  • IsamFile::FindLess
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::FindNextPartialKeyMatch

IsamFile::FindNextPartialKeyMatch

NAME
IsamFile::FindNextPartialKeyMatch
SYNOPSIS
NI IsamFile::FindNextPartialkeyMatch( pNI result )
DESCRIPTION
FindNextPartialKeyMatch attempts to find another row whose key matches the partial key specified as part of the sequence leading to the call to FindFirstPartialKeyMatch. If a matching row is found, CQL_YES is written to *result. If no matching row is found, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::FindFirstPartialKeyMatch
  • IsamFile::BeginIsamOperation
  • IsamFile::SetColumn
  • IsamFile::FindEqual
  • IsamFile::FindGreater
  • IsamFile::FindGreaterOrEqual
  • IsamFile::FindLess
  • IsamFile::FindLessOrEqual
  • IsamFile::FindNextPartialKeyMatch
  • IsamFile::FirstRow
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow

IsamFile::FirstRow

NAME
IsamFile::FirstRow
SYNOPSIS
NI IsamFile::FirstRow( pNI result )
DESCRIPTION
FirstRow finds the first row for a particular key. The key is selected by a preceding call to BeginIsamOperation. If a row is found, CQL_YES is written to *result. If the table is empty, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow

IsamFile::FlushDataToRecord

NAME
IsamFile::FlushDataToRecord
SYNOPSIS
NI FlushDataToRecord( VOID )
DESCRIPTION
FlushDataToRecord flushes column data to the Record class associated with the ISAM table. This prepares the Record class for a find operation using data specified by the application using IsamFile::SetColumn calls.

IsamFile::GetColumnLength

NAME
IsamFile::GetColumnLength
SYNOPSIS
NI IsamFile::GetColumnLength( pUS length, US columnNumber )
DESCRIPTION
GetColumnLength returns the length of column columnNumber for the current row.
SEE ALSO
  • IsamFile::GetColumnPointer
  • IsamFile::GetColumnValue
  • IsamFile::GetColumnInfo

IsamFile::GetColumnPointer

NAME
IsamFile::GetColumnPointer
SYNOPSIS
NI IsamFile::GetColumnPointer( pUC *pointer, US columnNumber )
DESCRIPTION
GetColumnPointer writes the address of the current storage for column columnNumber to *pointer.
SEE ALSO
  • IsamFile::GetColumnLength
  • IsamFile::GetColumnValue
  • IsamFile::GetColumnInfo

IsamFile::GetColumnValue

NAME
IsamFile::GetColumnValue
SYNOPSIS
NI IsamFile::GetColumnValue( pUC destination, US columnNumber )
DESCRIPTION
GetColumnValue copies the current value of column columnNumber to the address specified by destination.
SEE ALSO
  • IsamFile::GetColumnLength
  • IsamFile::GetColumnPointer
  • IsamFile::GetColumnInfo

IsamFile::GetColumnInfo

NAME
IsamFile::GetColumnInfo
SYNOPSIS
NI IsamFile::GetColumnInfo( pUC *data, pUS length, CqlColumnTypes *type, US columnNumber, pNI nullFlag )
NI IsamFile::GetColumnInfo( pUL length, CqlColumnTypes *type, US columnNumber, pNI nullFlag )
DESCRIPTION
GetColumnInfo comes in two flavors. Both flavors return the length and type of column columnNumber. The flavor with the argument data also returns the pointer to the current storage for the column. If the current value of the column is null, *nullFlag will be CQL_YES; otherwise *nullFlag will be CQL_NO;
SEE ALSO
  • IsamFile::GetColumnLength
  • IsamFile::GetColumnPointer
  • IsamFile::GetColumnValue

IsamFile::GetColumnInfoCurentSetting

NAME
IsamFile::GetColumnInfoCurrentSetting
SYNOPSIS
NI IsamFile::GetColumnInfoCurrentSetting(
    pUC* data,
    pUL length,
    CqlColumnTypes *type,
    US columnNumber,
    pNI nullFlag
)
DESCRIPTION
GetColumnInfoCurrentSetting returns data, length, type, and null information for a column. It differs from its GetColumnInfo cousins because it uses information provided by SetColumn calls instead of using fetched data. It is used for preparing keys for integrity violation checking.
IsamFile::IncrementTransactionCounter
NAME
IsamFile::IncrementTransactionCounter
SYNOPSIS
VOID IncrementTransactionCounter( VOID )
DESCRIPTION
IncrementTransactionCounter decrements a counter used to keep track of the number of nested transactions an ISAM table is involved in. The counter is used to identify the outermost transaction for an ISAM table.

IsamFile::IndexAddress

NAME
IsamFile::IndexAddress
SYNOPSIS
pIndex IndexAddress( VOID )
DESCRIPTION
IndexAddress returns the address of the FileManager class for the index file for an ISAM table. It is used to purge information from transaction tables for temporary files.

IsamFile::LastRow

NAME
IsamFile::LastRow
SYNOPSIS
NI IsamFile::LastRow( pNI result )
DESCRIPTION
LastRow finds the last row for a particular key. The key is selected by a preceding call to BeginIsamOperation. If a row is found, CQL_YES is written to *result. If the table is empty, CQL_NO is written to *result.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::NextRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow

IsamFile::NextRow

NAME
IsamFile::NextRow
SYNOPSIS
NI IsamFile::NextRow( pNI result )
DESCRIPTION
NextRow finds the row following the current position using the current key. NextRow can follow any operation which establishes a position. If the current position is the last row for the current key, CQL_NO is written to *result. Otherwise, CQL_YES is written to *result.
SEE ALSO
  • IsamFile::FirstRow
  • IsamFile::LastRow
  • IsamFile::PreviousRow
IsamFile::NumberOfEntriesEqualToKey(2-ISAM)
NAME
IsamFile::NumberOfEntriesEqualToKey
SYNOPSIS
NI IsamFile::NumberOfEntriesEqualToKey( pUL number )
DESCRIPTION
NumberOfEntriesEqualToKey determines the number of rows in the table matching a partially or fully specified key. NumberOfEntriesEqualToKey must be preceeded by a call to BeginIsamOperation and one or more calls to SetColumn. The result is written to *number.
SEE ALSO
  • IsamFile::NumberOfEntriesGreaterOrEqualToKey
  • IsamFile::NumberOfEntriesGreaterThanKey
  • IsamFile::NumberOfEntriesLessOrEqualToKey
  • IsamFile::NumberOfEntriesLessThanKey

IsamFile::NumberOfEntriesGreaterOrEqualToKey

NAME
IsamFile::NumberOfEntriesGreaterOrEqualToKey
SYNOPSIS
NI IsamFile::NumberOfEntriesGreaterOrEqualToKey( pUL number )
DESCRIPTION
NumberOfEntriesGreaterOrEqualToKey determines the number of rows in the table whose keys are greater than or equal to a partially or fully specified key. NumberOfEntriesGreaterOrEqualToKey must be preceeded by a call to BeginIsamOperation and one or more calls to SetColumn. The result is written to *number.
SEE ALSO
  • IsamFile::NumberOfEntriesEqualToKey
  • IsamFile::NumberOfEntriesGreaterThanKey
  • IsamFile::NumberOfEntriesLessOrEqualToKey
  • IsamFile::NumberOfEntriesLessThanKey

IsamFile::NumberOfEntriesGreaterThanKey

NAME
IsamFile::NumberOfEntriesGreaterThanKey
SYNOPSIS
NI IsamFile::NumberOfEntriesGreaterThanKey( pUL number )
DESCRIPTION
NumberOfEntriesGreaterThanKey determines the number of rows in the table whose keys are greater than a partially or fully specified key. NumberOfEntriesGreaterThanKey must be preceeded by a call to BeginIsamOperation and one or more calls to SetColumn. The result is written to *number.
SEE ALSO
  • IsamFile::NumberOfEntriesEqualToKey
  • IsamFile::NumberOfEntriesGreaterOrEqualToKey
  • IsamFile::NumberOfEntriesLessOrEqualToKey
  • IsamFile::NumberOfEntriesLessThanKey

IsamFile::NumberOfEntriesLessOrEqualToKey

NAME
IsamFile::NumberOfEntriesLessOrEqualToKey
SYNOPSIS
NI IsamFile::NumberOfEntriesLessOrEqualToKey( pUL number )
DESCRIPTION
NumberOfEntriesLessOrEqualToKey determines the number of rows in the table whose keys are less than or equal to a partially or fully specified key. NumberOfEntriesLessOrEqualToKey must be preceeded by a call to BeginIsamOperation and one or more calls to SetColumn. The result is written to *number.
SEE ALSO
  • IsamFile::NumberOfEntriesEqualToKey
  • IsamFile::NumberOfEntriesGreaterThanKey
  • IsamFile::NumberOfEntriesGreaterOrEqualToKey
  • IsamFile::NumberOfEntriesLessThanKey

IsamFile::NumberOfEntriesLessThanKey

NAME
IsamFile::NumberOfEntriesLessThanKey
SYNOPSIS
NI IsamFile::NumberOfEntriesLessThanKey( pUL number )
DESCRIPTION
NumberOfEntriesLessThanKey determines the number of rows in the table whose keys are less than a partially or fully specified key. NumberOfEntriesLessThanKey must be preceeded by a call to BeginIsamOperation and one or more calls to SetColumn. The result is written to *number.
SEE ALSO
  • IsamFile::NumberOfEntriesEqualToKey
  • IsamFile::NumberOfEntriesGreaterOrEqualToKey
  • IsamFile::NumberOfEntriesLessOrEqualToKey
  • IsamFile::NumberOfEntriesLessThanKey

DatabaseHandle::Open

NAME
DatabaseHandle::Open
SYNOPSIS
NI DatabaseHandle::Open( pAbstractTable* isamTable, pNC name )
DESCRIPTION
Open opens an ISAM table. name specifies the table to open. The handle of the opened table is returned in isamTable
SEE ALSO
  • IsamFile::Close

IsamFile::PreviousRow

NAME
IsamFile::PreviousRow
SYNOPSIS
NI IsamFile::PreviousRow( pNI result )
DESCRIPTION
PreviousRow finds the row preceding the current position using the current key. PreviousRow can follow any operation which establishes a position. If the current position is the first row for the current key, CQL_NO is written to *result. Otherwise, CQL_YES is written to *result.
SEE ALSO
  • IsamFile::FirstRow
  • IsamFile::LastRow
  • IsamFile::NextRow

IsamFile::RollbackDirtyRecords

NAME
IsamFile::RollbackDirtyRecords
SYNOPSIS
NI RollbackDirtyRecords( VOID )
DESCRIPTION
RollbackDirtyRecords purges the record cache of all updated records. It is called during a transaction rollback.

IsamFile::SetColumn

NAME
IsamFile::SetColumn
SYNOPSIS
NI IsamFile::SetColumn( pUC value )
NI IsamFile::SetColumn( pUC value, US columnNumber )
DESCRIPTION
SetColumn is used to specify column values. This may be as part of a search sequence or as part of a sequence adding a row to the table. The sequence begins with a call to either BeginIsamOperation or BeginRowOperation. The first form assumes that the column values are specified in sequence starting with column 0. The second form includes the columnNumber parameter, and allows column values to be specified in any order.
SEE ALSO
  • IsamFile::BeginIsamOperation
  • IsamFile::BeginRowOperation

IsamFile::SetDataFetched

NAME
IsamFile::SetColumn
SYNOPSIS
VOID SetDataFetched( VOID )
DESCRIPTION
SetDataFetched sets an ISAM table's data fetched flag. It is used during an update when SetColumn calls have been used to set all current values for a row.

IsamFile::TransactionCounter

NAME
IsamFile::TransactionCounter
SYNOPSIS
UNI TransactionCounter( VOID )
DESCRIPTION
TransactionCounter returns the current value of an ISAM table's transaction counter. This counter specifies the depth of nested transaction involvement for the ISAM table.

IsamFile::UpdateRow

NAME
IsamFile::UpdateRow
SYNOPSIS
NI IsamFile::UpdateRow( VOID )
DESCRIPTION
UpdateRow modifies the values associated with the current position. UpdateRow must be preceeded by a sequence of calls which establish a current position. Once the position is established, SetColumn calls are used to change one or more values. UpdateRow then completes the modification sequence.
SEE ALSO
  • IsamFile::AddRow
  • IsamFile::BeginRowOperation
  • IsamFile::SetColumn
  • IsamFile::DeleteRow