Description
The CTRecord class deals with the record concept. The CTRecord object is the "atomic" or basic element of the database system, in the sense that it has the smallest piece of integrated information. It represents the information in the data structure defined in the table. Multiple records may belong to one table, but a record belongs to only one table. The records are several times defined as the "rows" in the tables.
See Also
CTBase, CTDatabase, CTTable
Preconditions
In order to deal with the records, the user must logon to a Session, be connected to a database, and have a table open.
CTRecord Methods
Constructor / Destructor
- CTRecord(): Creates a CTRecord object
- Dispose(): Destroys a CTRecord object and resets all the dependent objects
Record Search
- First(): Moves to the first record in the table
- Last(): Moves to the last record in the table.
- Next(): Moves to the next record in the table.
- Prev(): Moves to the previous record in the table.
- Find(): Looks for the record in the table.
- FindRowid(): Verifies if a record at a given ROWID exist.
- FindTarget(): Looks for one specified record in the table.
- GetRecordCount(): Retrieves the number of records in table
- GetRowid(): Retrieves the record’s ROWID value
- BuildTargetKey(): Build a target key based on data in record buffer
Record Buffers
- AtPercentile(): Retrieve the record located at about the given percentile of the current index
- LockRecord(): Locks the current record.
- UnlockRecord(): Unlocks the current record.
- Clear(): Clears the record buffer
- Read(): Reads the current record
- Write(): Writes the record buffer to disk
- Delete(): Deletes the current record from table
- Reset(): Resets the record buffer to its initial condition
- IsNew(): Indicates if a record buffer is cleared
- IsEdited(): Indicates if a record buffer has been modified
- SetNew(): Sets the new record flag
- SetEdited(): Sets the change record flag
- GetRecordBuffer(): Retrieves the record buffer object
- GetRecordPos(): Retrieves the current record offset position
- EstimateSpan(): Estimate the approximate number of records between two key values
- SetRecordPos(): Sets the current record offset position.
- SetRecordOffset(): Updates the record offset.
- SeekRecord(): Moves the record to position pointed by offset
- GetRecordLength(): Retrieves the record length.
- GetRecordSize(): Retrieves the allocated record size.
- GetRecordLock(): Retrieve information if the record is locked or not.
- Compare(): Compares two CTRecord objects
- CopyBuffer(): Copy the contents of the record buffer
- SwitchContext(): Forces a c-tree ISAM context switch
Record Sets
- RecordSetOn(): Activates record sets.
- RecordSetOff(): Deactivates record sets.
Ranges
- RangeOn(): Establish a new range based on the key segment values
- RangeOff(): Terminate a range operation
- IsRangeOn(): Indicate if a range is active
Field Handling
- IsNullField(): Indicates if the field pointed by field number or name is a null field.
- IsVariableField(): Indicates if a field is in the variable portion of a record
- ClearField(): Clears the contents of a field
- GetFieldName(): Retrieves the field name based on the field number
- GetFieldType(): Retrieves the field type based on the field number or name
- GetFieldValue(): Retrieves the field contents as any value
- GetFieldAsString(): Retrieves the field contents as a string object - depricated: use SetFieldValue()
- GetFieldLength(): Retrieves the actual field data length
- GetFieldSize(): Retrieves the defined field size
- GetFieldOffset(): Retrieves the field offset in the record
- GetFieldAddress(): Retrieves the field address in the record buffer
- GetFieldByName(): Retrieves the field number based on the field name
- ClearField(): Clears the contents of a field.
- GetFieldValue(): Retrieves the field contents as any value
- GetFieldAsString(): Retrieves the field contents as a string object - deprecated: use SetFieldValue()
- SetFieldValue(): Sets the field contents
- SetFieldAsString(): Sets the field contents as a string object - deprecated: use SetFieldValue()
Alternative GetFieldAs and SetFieldAs Methods
The GetFieldAs... and SetFieldAs... methods listed below have been deprecated and replaced by GetFieldValue and SetFieldValue.
- GetFieldAsBool(): Retrieves the field contents as a boolean value
- GetFieldAsSigned(): Retrieves the field contents as a signed value
- GetFieldAsUnsigned(): Retrieves the field contents as an unsigned value
- GetFieldAsDate(): Retrieves the field contents as a date object
- GetFieldAsTime(): Retrieves the field contents as a time object
- GetFieldAsDateTime(): Retrieves the field contents as a date and time object
- GetFieldAsMoney(): Retrieves the field contents as a money object
- GetFieldAsFloat(): Retrieves the field contents as a float value
- GetFieldAsBlob(): Retrieves the field contents as a blob object
- GetFieldAsBigint(): Retrieves the field contents as a big integer (64-bit)
- GetFieldAsCurrency(): Retrieves the field contents as a CTCurrency object (64-bit)
- GetFieldAsNumber(): Retrieves the field contents as a CTNumber object
- SetFieldAsBool(): Sets the field contents as a boolean value
- SetFieldAsSigned(): Sets the field contents as a signed value
- SetFieldAsUnsigned(): Sets the field contents as an unsigned value
- SetFieldAsDate(): Sets the field contents as a date object
- SetFieldAsTime(): Sets the field contents as a time object
- SetFieldAsDateTime(): Sets the field contents as a date and time object
- SetFieldAsMoney(): Sets the field contents as a money object
- SetFieldAsFloat(): Sets the field contents as a float value
- SetFieldAsBlob(): Sets the field contents as a blob object
- SetFieldAsBigint(): Sets the field contents as a big integer (64-bit)
- SetFieldAsCurrency(): Sets the field contents as a CTCurrency object (64-bit)
- SetFieldAsNumber(): Sets the field contents as a CTNumber object
- GetFieldAsChar(): Retrieves the field contents as a char value
- GetFieldAsByte(): Retrieves the field contents as a byte (one-byte unsigned int) value
- GetFieldAsShort(): Retrieves the field contents as a COUNT (two-bytes signed int) value
- GetFieldAsWord(): Retrieves the field contents as a UCOUNT (unsigned two-byte integer) value
- SetFieldAsChar(): Sets the field contents as a char value
- SetFieldAsByte(): Sets the field contents as a byte (one-byte unsigned int) value
- SetFieldAsShort(): Sets the field contents as a COUNT (two-bytes signed int) value
- SetFieldAsWord(): Sets the field contents as a UCOUNT (unsigned two-byte integer) value
Index Handling
- GetDefaultIndex(): Retrieves the record default index number
- GetDefaultIndexName(): Retrieves the default record index name.
- SetDefaultIndex(): Sets the new record default index number.
Conditional Expression
- CndxEval(): Evaluates the compiled conditional expression
- CndxFree(): Releases any resource allocated by the conditional expression parser
- CndxCompile(): Initializes the conditional expression parser and compiles the expression
- CndxGetExpression(): Retrieves the last compiled expression
Filter Handling
- FilterRecord(): Sets the filtering for a record.
- GetFilter(): Retrieves the filter that is filtering the record.
- IsFilteredRecord(): Indicates if the record is being filtered or not
CTRecord.AtPercentile
Syntax
long AtPercentile(int offset )
Parameters
- Percent value
Description
Returns record offset at given percentile.
Return
GetRecordPosAtPercentile() returns record offset at given percentile.
See Also
EstimateSpan(), GetRecordPos()
CTRecord.BatchLoaded
Retrieves the number of batch records loaded into batch buffer.
Declaration
LONG CTRecord.BatchLoaded();
Description
CTRecord.BatchLoaded() retrieves the number of batch records loaded into batch buffer for CTBATCH_GET, CTBATCH_RANGE or a CTBATCH_PHYS operation. This is the number of records that are ready to be retrieved by the CTRecord.NextBatch() function.
Return
Returns the number of records ready for retrieval. In case of an error, CTRecord.BatchLoaded() throws an exception.
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.BatchTotal(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.SetBatch()
CTRecord.BatchLocked
Retrieves the number of locked batch records.
Declaration
LONG CTRecord.BatchLocked();
Description
CTRecord.BatchLocked() retrieves the number of records locked during a CTBATCH_GET, CTBATCH_RANGE or CTBATCH_PHYS operation. If CTBATCH_LOCK_READ or CTBATCH_LOCK_WRITE are specified in the batch mode, the CTRecord.BatchLocked() method returns the total number of records locked. If CTBATCH_LOCK_ONE is specified, or if either the CTBATCH_LOCK_READ or CTBATCH_LOCK_WRITE modes are not specified, CTRecord.BatchLocked() returns zero.
Return
Returns the number of locked records. In case of an error, CTRecord.BatchLocked() throws a CTException exception.
See Also
CTRecord.BatchMode(), CTRecord.BatchTotal(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.SetBatch(), CTRecord.BatchLoaded
CTRecord.BatchMode
Retrieves the current batch mode.
Declaration
CTBATCH_MODE CTRecord.BatchMode();
Description
Retrieves the current batch mode. The batch mode is set by calling the CTRecord.SetBatch() method. If a batch operation is not active, CTRecord.BatchMode() returns CTBATCH_NONE.
Return
Returns the current batch mode or CTBATCH_NONE if no batch operation is currently active.
See Also
CTRecord.BatchLocked(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.SetBatch(), CTRecord.BatchLoaded, CTRecord.BatchTotal
CTRecord.BatchTotal
Retrieves the total number of records affected by a batch retrieval operation.
Declaration
LONG CTRecord.BatchTotal();
Description
Retrieves the total number of records selected by a batch retrieval operation. If a batch operation is not active, BatchTotal() returns zero.
Return
Returns the total number of records selected by a batch retrieval operation. In case of an error, BatchTotal() throws a CTException.
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.SetBatch(), CTRecord.BatchLoaded
CTRecord.BuildTargetKey
Syntax
void BuildTargetKey(CTFIND_MODE FindMode, IntPtr targetkey, ref int targetlen);
void BuildTargetKey(CTFIND_MODE FindMode, byte[] targetkey, ref int targetlen);
Parameters
- FindMode [in] The find modes are: CTFIND_EQ, CTFIND_LT, CTFIND_LE, CTFIND_GT and CTFIND_GE.
- targetkey [out] target key buffer
- targetlen [in/out] target key length. Before calling BuildTargetKey() set targetlen with the size of targetkey buffer.
Description
Build a target key based on data in record buffer
Return
None.
See Also
FindTarget()
CTRecord.Clear
Syntax
void Clear( )
Parameters
This method has no parameters.
Description
Clears the record buffer. Following this, FairCom DB API .NET no longer has a current record.
Return
None.
Example
Rec1 = new CTRecord(pTable);
Rec1->Clear();
Rec1->SetFieldAsString("name", "Peter Thorn");
Rec1->SetFieldAsLong("age", 35);
Rec1->SetFieldAsString("phone", "555-55555");
Rec1->Write();
See Also
Delete(), Lock(), Read(), Reset(), Write()
CTRecord.ClearField
Syntax
void ClearField(int FieldNbr)
void ClearField(String FieldName)
Parameters
- FieldNbr [in] The field number.
- FieldName [in] The field name.
Description
Clears the contents of a field.
Return
None.
See Also
Clear(), Reset()
CTRecord.CndxCompile
Syntax
void CndxCompile(String Expression)
Parameters
- Expression [in] The conditional expression to be compiled.
Description
Initializes the conditional expression parser and compiles the expression. If an error is detected CndxCompile() throws a CTException with the appropriate c-tree error code.
Return
None.
See Also
CndxEval(), CndxFree(), CndxGetExpression()
CTRecord.CndxEval
Syntax
bool CndxEval()
Parameters
This method has no parameters.
Description
Evaluates the compiled conditional expression against the current record. Returns true or false depending on the result of the execution. If an error is detected, CndxEval() throws a CTException with the appropriate c-tree error code.
Return
CndxEval() returns true or false.
See Also
CndxCompile(), CndxFree(), CndxGetExpression()
CTRecord.CndxFree
Syntax
void CndxFree()
Parameters
This method has no parameters.
Description
Releases any resource allocated by the conditional expression parser. Resources allocated by the conditional expression parser are also automatically released when the CTRecord class is destroyed
Return
None
See Also
CndxCompile(), CndxEval(), CndxGetExpression()
CTRecord.CndxGetExpression
Syntax
void CndxGetExpression(StringBuilder Expression)
Parameters
- Expression [out] Receives the conditional expression string. If no conditional expression string exists, expression is cleared.
Description
Retrieves the last compiled expression
Return
None
See Also
CndxCompile(), CndxEval(), CndxFree()
CTRecord.Compare
Syntax
bool Compare( CTRecord Record)
Parameters
- Record [in] The record to compare to.
Description
Compares the current CTRecord object with the CTRecord object passed in.
Return
True if the two records are identical, false otherwise.
CTRecord.CopyBuffer
Syntax
void CopyBuffer( CTRecord Record)
Parameters
- Record [in] The source record.
Description
Copy the contents of the record buffer.
Return
None
CTRecord.CTRecord
Syntax
CTRecord(CTTable& Handle)
CTRecord(CTTable* Handle)
CTRecord(CTRecord& Handle)
CTRecord(CTRecord* Handle)
Parameters
- Handle [in] The Table or Record Object. If the prototype CTRecord(CTTable& Handle) or CTRecord(CTTable* Handle) is used, Handle is the CTTable Object. If the prototype CTRecord(CTRecord & Handle) or CTRecord(CTRecord * Handle) is used, Handle is the CTRecord Object. The CTRecord object being created is a child of the CTTable or CTRecord object.
Description
This is the constructor for the CTRecord class.
See Also
Dispose()
CTRecord.Delete
Syntax
void Delete( )
Parameters
This method has no parameters.
Description
Deletes the current record from table. The record must be locked with one of the write locks before it is deleted.
Return
None.
Example
pRec->Clear();
pRec->SetDefaultIndex("name");
pRec->SetFieldAsString("name", "Peter Thorn");
if(pRec->Find(CTFIND_EQ))
{ pRec->LockRecord(CTLOCK_WRITE_BLOCK);
pRec->Delete();
}
See Also
Clear(), CTBase.Lock(), LockRecord(), Read(), Reset(), Write()
CTRecord.Dispose
Syntax
Void Dispose()
Parameters
This method has no parameters.
Description
This is the destructor for the CTRecord class. It frees the allocated memory to the Record.
See Also
CTRecord()
CTRecord.EndBatch
Terminates or cancels a batch operation.
Declaration
void CTRecord.EndBatch();
Description
A batch operation must be terminated by calling the CTRecord.EndBatch() function. Once a batch operation is started, by calling CTRecord.SetBatch(), no other batch operation is allowed to start until the current batch operation is terminated.
When performing batch retrieval operations, you may cancel the batch operation before retrieving all the records by calling CTRecord.EndBatch().
If the batch operation is a CTBATCH_RANGE them you must also call the CTRecord.RangeOff() function to terminate the index range used for the batch operation.
In case of errors, CTRecord.EndBatch() throws a CTException.
Return
void
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.SetBatch(), CTRecord.BatchLoaded, CTRecord.BatchTotal
CTRecord.EstimateSpan
SYNTAX
long EstimateSpan(Byte[] Key1, Byte[] Key2)
PARAMETERS
- key1 [IN] First key value. BuildTargetKey() may be used to build the key value.
- key2 [IN] Second key value. BuildTargetKey() may be used to build the key value
DESCRIPTION
Estimate the approximate number of records between two key values.
RETURN
Return the estimated number of records between two key values.
SEE ALSO
AtPercentile(), GetRecordPos()
CTRecord.Find
Syntax
bool Find (CTFIND_MODE FindMode)
Parameters
-
FindMode [in] The find mode for the search. Valid values for the find mode are shown in the "Find Modes".
Notice that when the FindMode CTFIND_EQ is used, all segments that compose the index must be fulfilled, and also the index cannot allow duplicates.
Description
Looks for the record in the table.
Return
Find return true if the record is found, false otherwise.
Example
CTRecord searchRecord = new CTRecord(myTable);
searchRecord.Clear();
searchRecord.SetDefaultIndex("name");
searchRecord.SetFieldAsString("name", "Peter Thorn");
if(searchRecord.Find(CTFIND_EQ))
{ searchRecord.LockRecord(CTLOCK_WRITE_BLOCK);
searchRecord.Delete();
}
See Also
FindTarget(), First(), Last(), Next(), Prev()
CTRecord.FindRowid
Syntax
bool FindRowid(CTROWID rowid, CTFIND_MODE FindMode)
Parameters
- rowid [in] Rowid of record being sought
-
FindMode [in] The find mode for the search. Valid values for the find mode are shown in the "Find Modes".
Notice that when the FindMode CTFIND_EQ is used, all segments that compose the index must be fulfilled, and also the index cannot allow duplicates.
Description
Verifies if a record exist at a given ROWID value. To retrieve the record ROWID, use GetRowid(). One table has the ROWID record enabled by default at creation time. To verify if one table has support to ROWID, use CTTable.HasRowid().
Return
FindRowid() returns true if the record is located, false otherwise.
See Also
CTTable.HasRowid(), GetRowid()
CTRecord.FindTarget
Syntax
bool FindTarget(pVOID target, CTFIND_MODE FindMode)
Parameters
- target [in] The target key to look for in the table
-
FindMode [in] The find mode for the search. Valid values for the find mode are shown in the "Find Modes".
Notice that when the FindMode CTFIND_EQ is used, all segments that compose the index must be fulfilled, and also the index cannot allow duplicates.
Description
Looks for one specified record in the table.
Return
FindTarget() return true if the record is found, false otherwise.
See Also
Find(), First(), Last(), Next(), Prev()
CTRecord.First
Syntax
bool First( )
Parameters
This method has no parameters.
Description
Moves to first record in table.
Return
First returns true if the record is found, false otherwise.
Example
pRec->First();
do {
Console.Write("\nName: {0}", pRec ->
GetFieldAsString("name").c_str()); }
while (pRec->Next());
See Also
Find(), Last(), Next(), Prev()
CTRecord.FullTextSearchOff
Turn off Full-Text Search.
See CTRecord.FullTextSearchOff
CTRecord.FullTextSearchOn
Set the Full-Text Search criteria.
CTRecord.GetDefaultIndex
Syntax
int GetDefaultIndex( )
Parameters
This method has no parameters.
Description
Retrieves the default record index number.
Return
GetDefaultIndex() returns the default index number.
Example
i = pRec->GetDefaultIndex();
if (i == 1)
{
pRec->Clear();
pRec->First();
}
See Also
GetDefaultIndexName(), SetDefaultIndex()
CTRecord.GetDefaultIndexName
Syntax
String GetDefaultIndexName( )
Parameters
This method has no parameters.
Description
Retrieves the default record index name.
Return
GetDefaultIndexName() returns the default index name.
Example
if ("name" == pRec->GetDefaultIndexName())
{
pRec->Clear();
pRec->SetFieldAsString("name", "Peter Thorn");
pRec->Find(CTFIND_EQ);
}
See Also
GetDefaultIndex(), SetDefaultIndex()
CTRecord.GetErrorIndex
Declaration
NINT CTRecord.GetErrorIndex();
Description
Retrieves the index number that cause a record insert or record update operation to fail. This function should only be called after a Write() call fails. The error index number value is maintained until the next call to Write().
Return Values
A number from 0 to n to indicate which index caused the error. A value of 0 represents the first index, 1 represents the second index, and so on. If the index number can not be obtained, GetErrorIndex() returns -1.
See Also
CTRecord.Write()
CTRecord.GetFieldAddress
Syntax
pVOID GetFieldAddress(int FieldNbr)
pVOID GetFieldAddress(String FieldName)
Parameters
- FieldNbr [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field address in the record buffer.
Return
GetFieldAddress() returns the field address.
See Also
GetFieldName(), GetFieldOffset(), GetFieldSize(), GetFieldType()
CTRecord.GetFieldAsBigint
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTBigint GetFieldAsBigint(int FieldNumber)
CTBigint GetFieldAsBigint(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a big integer (64-bit).
Return
GetFieldAsBigint() returns the contents as a big integer value.
See Also
GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsBigint(), GetFieldValue()
CTRecord.GetFieldAsBlob
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void GetFieldAsBlob(int FieldNumber, CTBlob& value)
void GetFieldAsBlob(String FieldName, CTBlob& value)
Parameters
- FieldNumber [in] The field number.
- value [out] The Blob object, returned by the method.
- FieldName [in] The field name.
Description
Retrieves the field contents as a CTBlob object
Return
None.
See Also
GetFieldAsBigint(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsBlob(), GetFieldValue()
CTRecord.GetFieldAsBool
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
bool GetFieldAsBool(int FieldNumber)
bool GetFieldAsBool(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a boolean value
Return
GetFieldAsBool() returns the contents as a boolean value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsBool(), GetFieldValue()
CTRecord.GetFieldAsBytes
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
UTEXT GetFieldAsBytes(int FieldNumber)
UTEXT GetFieldAsBytes(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a UTEXT value (unsigned one-byte integer).
Return
GetFieldAsBytes() returns the contents as a UTEXT value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsByte(), GetFieldValue()
CTRecord.GetFieldAsCurrency
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTCurrency GetFieldAsCurrency(int FieldNumber)
CTCurrency GetFieldAsCurrency(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a CTCurrency object.
Return
GetFieldAsCurrency() returns the contents as a CTCurrency object.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsCurrency(), GetFieldValue()
CTRecord.GetFieldAsDate
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTDate GetFieldAsDate(int FieldNumber)
CTDate GetFieldAsDate(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a CTDate object
Return
GetFieldAsDate() returns the contents as CTDate object.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsDate(), GetFieldValue()
CTRecord.GetFieldAsDateTime
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTDateTime GetFieldAsDateTime(int FieldNumber)
CTDateTime GetFieldAsDateTime(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a CTDateTime object
Return
GetFieldAsDateTime() returns the contents as a CTDateTime object.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsDateTime(), GetFieldValue()
CTRecord.GetFieldAsFloat
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTFLOAT GetFieldAsFloat(int FieldNumber)
CTFLOAT GetFieldAsFloat(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a float value
Return
GetFieldAsFloat() returns the contents as a float value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsFloat(), GetFieldValue()
CTRecord.GetFieldAsMoney
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTMoney GetFieldAsMoney(int FieldNumber)
CTMoney GetFieldAsMoney(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a CTMoney object.
Return
GetFieldAsMoney() returns the contents as a CTMoney object.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsMoney(), GetFieldValue()
CTRecord.GetFieldAsNumber
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTNumber GetFieldAsNumber(int FieldNumber)
CTNumber GetFieldAsNumber(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a CTNumber object
Return
GetFieldAsFloat() returns the contents as a CTNumber object.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsNumber(), GetFieldValue()
CTRecord.GetFieldAsShort
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
COUNT GetFieldAsShort(int FieldNumber)
COUNT GetFieldAsShort(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a 2-bytes signed integer (COUNT) value.
Return
GetFieldAsShort() returns the contents as a COUNT value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsShort(), GetFieldValue()
CTRecord.GetFieldAsSigned
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
int GetFieldAsSigned(int FieldNumber)
int GetFieldAsSigned(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a signed value
Return
GetFieldAsSigned() returns the contents as a signed value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsSigned(), GetFieldValue()
CTRecord.GetFieldAsString
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
String GetFieldAsString(int FieldNumber)
String GetFieldAsString( String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a String object.
Return
GetFieldAsString() returns the contents as a String object.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsString(), GetFieldValue()
CTRecord.GetFieldAsString
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
TEXT GetFieldAsString(int FieldNumber)
TEXT GetFieldAsString(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a char value.
Return
GetFieldAsString() returns the contents as a TEXT value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsChar(), GetFieldValue()
CTRecord.GetFieldAsTime
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
CTTime GetFieldAsTime(int FieldNumber)
CTTime GetFieldAsTime(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as a CTTime object
Return
GetFieldAsTime() returns the contents as a CTTime object.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsUnsigned(), GetFieldAsWord(), SetFieldAsTime(), GetFieldValue()
CTRecord.GetFieldAsUnsigned
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
uint GetFieldAsUnsigned (int FieldNumber)
uint GetFieldAsUnsigned(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as an unsigned value
Return
GetFieldAsUnsigned() returns the contents as an unsigned value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsWord(), SetFieldAsUnsigned(), GetFieldValue()
CTRecord.GetFieldAsWord
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
UCOUNT GetFieldAsWord(int FieldNumber)
UCOUNT GetFieldAsWord(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field contents as an unsigned two-bytes integer value (UCOUNT).
Return
GetFieldAsWord() returns the contents as an UCOUNT value.
See Also
GetFieldAsBigint(), GetFieldAsBlob(), GetFieldAsBool(), GetFieldAsByte(), GetFieldAsChar(), GetFieldAsCurrency(), GetFieldAsDate(), GetFieldAsDateTime(), GetFieldAsFloat(), GetFieldAsMoney(), GetFieldAsNumber(), GetFieldAsShort(), GetFieldAsSigned(), GetFieldAsString(), GetFieldAsTime(), GetFieldAsUnsigned(), SetFieldAsWord(), GetFieldValue()
CTRecord.GetFieldByName
Syntax
int GetFieldByName(String FieldName)
Parameters
- FieldName [in] The field name.
Description
Retrieves the field number based on the field name.
Return
GetFieldByName() returns the field number.
See Also
GetFieldLength(), GetFieldName(), GetFieldOffset(), GetFieldSize(), GetFieldType()
CTRecord.GetFieldLength
Syntax
VRLEN GetFieldLength(int FieldNbr)
VRLEN GetFieldLength(String FieldName)
Parameters
- FieldNbr [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the actual field data length.
Return
GetFieldLength() returns the field length.
See Also
GetFieldName(), GetFieldOffset(), GetFieldSize(), GetFieldType()
CTRecord.GetFieldName
Syntax
String GetFieldName(int FieldNumber)
Parameters
- FieldNumber [in] The field number.
Description
Retrieves the field name based on the field number.
Return
GetFieldName() returns the field name.
Example
field_name=pRec->GetFieldName(1);
See Also
GetFieldOffset(), GetFieldType()
CTRecord.GetFieldOffset
Syntax
VRLEN GetFieldOffset(int FieldNbr)
VRLEN GetFieldOffset(String FieldName)
Parameters
- FieldNbr [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field record offset.
Return
GetFieldOffset() returns the field offset.
See Also
GetFieldAddress(), GetFieldLength(), GetFieldName(), GetFieldType()
CTRecord.GetFieldSize
Syntax
VRLEN GetFieldSize (int FieldNbr)
VRLEN GetFieldSize(String FieldName)
Parameters
- FieldNbr [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field defined size.
Return
GetFieldSize() returns the defined field size.
See Also
GetFieldLength(), GetFieldName(), GetFieldOffset(), GetFieldType()
CTRecord.GetFieldType
Syntax
CTDBTYPE GetFieldType(int FieldNumber)
CTDBTYPE GetFieldType(String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Retrieves the field type based on the field number or name.
Return
GetFieldType() returns the field type.
See Also
GetFieldName(), GetFieldOffset()
CTRecord.GetFieldValue
Syntax
CTDBRET GetFieldValue(int FieldNumber, out CTSIGNED Value)
CTDBRET GetFieldValue(String FieldName, out CTSIGNED Value)
CTDBRET GetFieldValue(int FieldNumber, out CTUNSIGNED Value)
CTDBRET GetFieldValue(String FieldName, out CTUNSIGNED Value)
CTDBRET GetFieldValue(int FieldNumber, out CTBIGINT Value)
CTDBRET GetFieldValue(String FieldName, out CTBIGINT Value)
CTDBRET GetFieldValue(int FieldNumber, out CTUBIGINT Value)
CTDBRET GetFieldValue(String FieldName, out CTUBIGINT Value)
CTDBRET GetFieldValue(int FieldNumber, out CTFLOAT Value)
CTDBRET GetFieldValue(String FieldName, out CTFLOAT Value)
CTDBRET GetFieldValue(int FieldNumber, out float Value)
CTDBRET GetFieldValue(String FieldName, out float Value)
CTDBRET GetFieldValue(int FieldNumber, out StringBuilder Value)
CTDBRET GetFieldValue(String FieldName, out StringBuilder Value)
CTDBRET GetFieldValue(int FieldNumber, out bool Value)
CTDBRET GetFieldValue(String FieldName, out bool Value)
CTDBRET GetFieldValue(int FieldNumber, out Byte[]Value)
CTDBRET GetFieldValue(String FieldName, out Byte []Value)
CTDBRET GetFieldValue(int FieldNumber, out CTBlob Value)
CTDBRET GetFieldValue(String FieldName, out CTBlob Value)
CTDBRET GetFieldValue(int FieldNumber, out CTNumber Value)
CTDBRET GetFieldValue(String FieldName, out CTNumber Value)
CTDBRET GetFieldValue(int FieldNumber, out CTDate Value)
CTDBRET GetFieldValue(String FieldName, out CTDate Value)
CTDBRET GetFieldValue(int FieldNumber, out CTTime Value)
CTDBRET GetFieldValue(String FieldName, out CTTime Value)
CTDBRET GetFieldValue(int FieldNumber, out CTDateTime Value)
CTDBRET GetFieldValue(String FieldName, out CTDateTime Value)
CTDBRET GetFieldValue(int FieldNumber, out DateTime Value)
CTDBRET GetFieldValue(String FieldName, out DateTime Value)
CTDBRET GetFieldValue(int FieldNumber, out CTMoney Value)
CTDBRET GetFieldValue(String FieldName, out CTMoney Value)
CTDBRET GetFieldValue(int FieldNumber, out CTCurrency Value)
CTDBRET GetFieldValue(String FieldName, out CTCurrency Value)
Parameters
- FieldNumber [in] - The field number.
- FieldName [in] - The field name.
- Value [out] - The retrieved field value.
Description
Retrieves the field contents. The field can be specified using either the FieldName or the FieldNumber.
Return
The c-tree Plus error code
See Also
CTRecord.GetFilter
SYNTAX
void GetFilter (StringBuilder cndexpr)
PARAMETERS
- cndexpr [out] Receive the filtering expression.
DESCRIPTION
Retrieves the filter that is filtering the record.
RETURN
None.
SEE ALSO
IsFiltered(), SetFilter()
CTRecord.GetFullTextSearchErrorDetails
Get detail about Full-Text Search error.
See CTRecord.GetFullTextSearchErrorDetails
CTRecord.GetRecordBuffer
Syntax
IntPtr GetRecordBuffer( )
void GetRecordBuffer(Byte[] buffer)
Parameters
This method can be used with no parameters or it can be used with the Byte[] buffer parameter to return the complete record buffer in a Byte array.
Description
Retrieves the record buffer object.
The Byte[] buffer parameter provides the ability to return the complete record buffer in a Byte array.
Return
IntPtr GetRecordBuffer() returns the record buffer object.
CTRecord.GetRecordCount
Syntax
CTUINT64 GetRecordCount( )
Parameters
This method has no parameters.
Description
Retrieves the number of records in table. It may be used in conjunction with First() and Next() to retrieve all records in the table.
Return
GetRecordCount() returns the number of records in the table.
See Also
First(), Next()
CTRecord.GetRecordKeyPos
Syntax
long CTRecord.GetRecordKeyPos()
Parameters
- None
Description
Retrieves the given record position in the default index.
Return
Position. The returned position is the Ordinal key position, not a file offset.
Throws a CTException exception object if an error occurs.
CTRecord.GetRecordLength
Syntax
int GetRecordLength( )
Parameters
This method has no parameters.
Description
Retrieves the record length.
Return
GetRecordLength() returns the record length.
See Also
GetRecordSize()
CTRecord.GetRecordLock
Syntax
LOCK_MODE GetRecordLock( )
Parameters
This method has no parameters.
Description
Retrieve information if the record is locked or not.
Return
Returns LOCK_MODE.FREE_LOCK if record is not locked.
Returns LOCK_MODE.READ_LOCK if record is locked with a read lock.
Returns LOCK_MODE.WRITE_LOCK if the record has a write lock.
See Also
LockRecord()
CTRecord.GetRecordPos
Syntax
long GetRecordPos( )
Parameters
This method has no parameters.
Description
Retrieves the current record offset position
Return
None.
See Also
SetRecordOffset()
CTRecord.GetRecordPosAtOffset
Declaration
public virtual CTDBRET GetRecordPosAtOffset(out long Offset)
Parameters:
- offset
On input, offset should be in the range from zero (0) to recordCount.
On output, offset is set to the record offset.
Description
Retrieve the offset of the nth record of the current index.
Returns the record offset at a given offset.
Return Values
Value |
Symbolic Constant |
Explanation |
|---|---|---|
0 |
CTDBRET_OK |
Successful operation. |
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.
CTRecord.GetRecordPosAtPercentile
Declaration
long GetRecordPosAtPercentile(int Offset)
Parameters:
- Offset - percent Value
Description
Retrieve the current record offset position.
Returns the record offset at a given percentile.
Return Values
Value |
Symbolic Constant |
Explanation |
|---|---|---|
0 |
CTDBRET_OK |
Successful operation. |
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.
CTRecord.GetRecordSize
Syntax
VRLEN GetRecordSize( )
Parameters
This method has no parameters.
Description
Retrieves the allocated record size.
Return
GetRecordSize() returns the allocated record size.
See Also
GetRecordLength()
CTRecord.GetRowid
Syntax
CTROWID GetRowid( )
Parameters
This method has no parameters.
Description
Retrieves the record’s ROWID value
Return
GetRowid() returns the ROWID for the record.
See Also
CTTable.HasRowid(), FindRowid()
CTRecord.InsertBatch
Inserts a new record into a batch buffer.
Declaration
void CTRecord.InsertBatch();
Description
Inserts a new record into an internally maintained batch buffer. When the batch buffer fills up, the group of records stored in the batch buffer are inserted into the table. If CTRecord.EndBatch() is called and the batch buffer still contains records, a new insert record operation is performed for the remaining records before the batch operation is terminated.
For transaction controlled files, the batch insertion operation is treated as one all or nothing operation. If no explicit transaction is started, each insertion of records with will start and end its own transaction. Even if an explicit transaction is started, each insertion operation is treated independently through safe points.
Note: Currently, all record insertion operations do not perform any conversion of records images, key values, and record position for heterogeneous client/server implementations.
The following steps must be taken to perform a batch insert record operation:
- Call CTRecord.SetBatch() function, with CTBATCH_INS mode, to insert a group of records.
For each record to be inserted perform the following operations:
- Call CTRecord.Clear() to clear a record buffer
- For each field in the record call SetFieldValue() or one of the deprecated CTRecord.SetFieldAs..() functions to set the field data.
- Call CTRecord.InsertBatch() to insert the record into the batch buffer.
- Call CTRecord.EndBatch() to indicate that no more records will be inserted.
In case of errors, CTRecord.InsertBatch() throws a CTException.
Return
void
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.EndBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.SetBatch(), CTRecord.BatchLoaded, CTRecord.BatchTotal
CTRecord.IsBatchActive
Indicates if a batch operation is under way or not.
Declaration
CTBOOL CTRecord.IsBatchActive();
Description
Indicates if a batch operation is active or not. This is equivalent to CTRecord.BatchMode() returning CTBATCH_NONE.
Return
Value |
Symbolic Constant |
Explanation |
|---|---|---|
0 |
NO |
No batch operation is under way. |
1 |
YES |
A batch operation is under way. |
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.NextBatch(), CTRecord.SetBatch(), CTRecord.BatchLoaded, CTRecord.BatchTotal
CTRecord.IsEdited
Syntax
bool IsEdited( )
Parameters
This method has no parameters.
Description
Indicates if a record buffer has been modified.
Return
IsEdited() returns true if the record has been modified, false otherwise
See Also
SetEdited(), Write()
CTRecord.IsFiltered
SYNTAX
bool IsFiltered( )
PARAMETERS
This method has no parameters.
DESCRIPTION
Indicates if the record is being filtered or not.
RETURN
IsFiltered() returns true if there is one filter set to the record, and false otherwise.
SEE ALSO
GetFilter(), SetFilter()
CTRecord.IsFullTextSearchOn
Indicate if Full-Text Search is active on the record.
See CTRecord.IsFullTextSearchOn
CTRecord.IsNew
Syntax
bool IsNew( )
Parameters
This method has no parameters.
Description
Indicates if a record buffer is cleared.
Return
IsNew() returns true if the record buffer is cleared, false otherwise.
See Also
Clear(), SetNew()
CTRecord.IsNullField
Syntax
bool IsNullField(int FieldNumber)
bool IsNullField( String FieldName)
Parameters
- FieldNumber [in] The field number.
- FieldName [in] The field name.
Description
Indicates if the field specified by field number or name is a null field.
Return
IsNullField() returns true if the field is null, false otherwise.
CTRecord.IsRangeOn
Syntax
bool IsRangeOn()
Parameters
This method has no parameters
Description
Indicate if a range is active
Return
IsRangeOn() returns true if a Range is active, false otherwise.
See Also
RangeOff(), RangeOn()
CTRecord.IsRecordSetOn
Declaration
CTBOOL CTRecord.IsRecordSetOn();
Description
Indicates if a record set is active or not. A record set is active after a successful call to RecordSetOn(). A record set can be switched off by calling RecordSetOff().
Return Values
Returns YES if a record set if active and NO if a record set is not active.
See Also
CTRecord.RecordSetOn(), CTRecord.RecordSetOff()
CTRecord.IsVariableField
Syntax
bool IsVariableField(int FieldNbr)
bool IsVariableField( String FieldName)
Parameters
- FieldNbr [in] The field number.
- FieldName [in] The field name.
Description
Indicates if a field is in the variable portion of a record
Return
IsVariableField() returns true if a field is in the variable portion of a record, and false otherwise.
CTRecord.Last
Syntax
bool Last ( )
Parameters
This method has no parameters.
Description
Moves to the last record in the table.
Return
Last returns true if the record is found, false otherwise.
See Also
Find(), First(), Next(), Prev()
CTRecord.LockRecord
Syntax
void LockRecord(CTLOCK_MODE mode)
Parameters
- mode [in] the lock mode. Valid values for the lock mode are shown in the "FairCom DB API .NET Definitions".
Description
Locks the current record. In order to use this method, a record must be considered current. A record is set as the current record by update methods (Write()) or search methods (Find(), FindTarget(), First(), Next(), Prev(), Last(), SeekRecord()).
After a Record has been cleared (Clear()), no current record buffer is kept, and LockRecord() cannot be used. In this case, use the CTBase.Lock() method.
UnlockRecord() may be used to free the record lock. LockRecord(CTLOCK_FREE) has the same effect. Unlock() and Lock(CTLOCK_FREE) free all session wide locks but DO NOT free any records locked with LockRecord().
A record that is locked with one of the READ() locks available allows any other user with a READ() lock to read that record. No one can update one record using a READ() lock. When one user gets a WRITE() lock in a record, it means he/she may update that particular record, and until the record is freed, no one else is able to read that particular record.
Notice that LockRecord() should be called BEFORE modifying the record contents; otherwise, the changes will be lost.
When working with LockRecord(), the user must be certain to release the lock before moving to the next record or will need to use CTTable.UnlockTable() to release all record locks from a table at once. Do not mix the use of CTBase.Lock() and LockRecord() since an error DLOK_ERR (42), indicating record already locked, may occur.
Return
None.
See Also
CTBase.Lock(), UnlockRecord(), Locking
CTRecord.Next
Syntax
bool Next( )
Parameters
This method has no parameters.
Description
Moves to the next record in the table. Before calling Next() for the first time in a table, one of the Record search methods must be used: Find() or First().
Return
Next returns true if the record is found, false otherwise.
Example
pRec->First();
do {
Console.Write("\nName: {0}", pRec ->
GetFieldAsString("name").c_str()); }
while (pRec->Next());
See Also
Find(), First(), Last(), Prev()
CTRecord.NextBatch
Retrieves the next record from the batch buffer.
Declaration
void CTRecord.NextBatch();
Description
If the mode of the batch operation is CTBATCH_GET, CTBATCH_RANGE, or CTBATCH_PHYS, then it may be necessary to retrieve all records that match the batch criteria. The records are retrieved by calling CTRecord.NextBatch() method.
CTRecord.NextBatch() method retrieves a record data from the batch buffer maintained by FairCom DB API’s record object. After a successful call to CTRecord.NextBatch() method, the field data can be retrieved by calling the appropriate CTRecord.GetFieldAs...() methods.
In case of errors, CTRecord.NextBatch() throws an exception.
Return
The user will receive an exception if the batch has ended.
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.SetBatch(), CTRecord.BatchLoaded, CTRecord.BatchTotal
CTRecord.NextInBatch
Retrieves the next batch of records from batch retrieval operation.
Declaration
bool CTRecord.NextInBatch();
Description
If the mode of the batch operation is one of CTBATCH_GET, CTBATCH_RANGE or CTBATCH_PHYS then it may be necessary to retrieve all records that match the batch criteria. The records are retrieved by calling NextInBatch() method. NextInBatch() method retrieve the record data from the batch buffer maintained by FairCom DB API's record handle. After a successful call to NextInBatch() function the field data can be retrieved by calling the appropriate GetFieldAs...() methods.
Return
YES if successful, NO if no more record match the criteria.
Throws a CTException on error.
NextInBatch() does not throw an exception when the end of the batch is reached.
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.SetBatch(), CTRecord.BatchLoaded
CTRecord.Prev
Syntax
bool Prev( )
Parameters
This method has no parameters.
Description
Moves to the previous record in the table. Before calling Prev() for the first time in a table, one of the Record search methods must be used: Find() or Last().
Return
Prev() returns true if the record is found, false otherwise.
See Also
Find(), First(), Next(), Prev()
CTRecord.RangeOff
Syntax
void RangeOff( )
Parameters
This method has no parameters.
Description
Terminate a range operation.
Return
None
See Also
IsRangeOn(), RangeOn()
CTRecord.RangeOn
Syntax
void RangeOn(int SegCount, Byte[] lRange, Byte[] uRange, int[] operators)
Parameters
- SegCount [IN] segcount indicates the number of index segments values that should be used for setting the range, and the number of operators, since there must be one operator for each key segment in lRange and/or uRange.
- lRange [IN] lrange is a buffer with the lower range segment values. Use the function ctdbBuildTargetKey() to build the lRange buffer.
- uRange [IN] urange is a buffer with the upper range segment values. Use the function ctdbBuildTargetKey() to build the uRange buffer.
- operators [IN] operators is an array of operators. There must be one operator for each key segment in lRange and/or uRange.
The operators RANGE_OP.EQ, RANGE_OP.NE, RANGE_OP.GT, RANGE_OP.GE, RANGE_OP.LE, RANGE_OP.LT are open ended and use only the lrange buffer for range values and the equivalent key segment in urange is ignored and maybe set to null (ascii \0 values). The operators RANGE_OP.BET, RANGE_OP.BET_IE, RANGE_OP.BET_EI, RANGE_OP.BET_EE and RANGE_OP.NOTBET use both lrange and urange buffers to establish the lower and upper bound values.
Description
RangeOn() establish a new range based on the key segment values passed on lRange and uRange buffers, and the operators for each segment. Once the range is set, use First(), Next(), Prev() and Last() to navigate the records in the specified range.
The range is set for all index entries that are situated between the lower bounds and upper bounds values. The segment values are stored in lrange and urange buffers in the same order and type of the index segment definition. If a previous range exists for this index, the previous range is released and the new range is established. Ranges take precedence over sets. If a record handle has a set established, record from a range will fetched instead of records from a range. Once the range is terminated, the records from a set is established..
Return
None.
See Also
IsRangeOn(), RangeOff()
CTRecord.Read
Syntax
void Read( )
Parameters
This method has no parameters.
Description
Reads the current record.
Return
None.
See Also
Clear(), Delete(), Reset(), Write()
CTRecord.RecordSetOff
Syntax
void RecordSetOff( )
Parameters
This method has no parameters.
Description
Deactivates record sets.
Return
None.
Example
pRec->SetDefaultIndex("last name");
pRec->SetFieldAsString("last name", "silva");
pRec->RecordSetOn(5);
pRec->First();
pRec->RecordSetOff();
See Also
RecordSetOn()
CTRecord.RecordSetOn
Syntax
void RecordSetOn(int siglen)
Parameters
- siglen [in] The number of key bytes.
Description
Activates record sets. After activating a record set, set the fields and index desired in the search, and then perform the search using the regular search functions. Notice that it is necessary to set the first siglen bytes from the index segments.
Return
None.
Example
// display all records in set - no error checking
void DisplayAll(CTRecord& pRec)
{
int count = 0;
pRec.Clear();
pRec.SetDefaultIndex("index_name");
pRec.SetFieldAsString(0, "silva");
pRec.RecordSetOn(5);
if (pRec.First())
{
do
{
count++;
PrintRecord(pRec);
}
while (pRec.Next());
}
Console.Write("{0} records in set\n", count);
}
See Also
RecordSetOff()
CTRecord.Reset
Syntax
void Reset( )
Parameters
This method has no parameters.
Description
Resets the record buffer to its initial condition.
Return
None.
See Also
Clear(), Delete(), Read(), Write()
CTRecord.SeekRecord
Syntax
void SeekRecord(CTOFFSET offset)
Parameters
- offset [in] The record offset position.
Description
Moves the record to the position pointed to by offset.
Return
None.
See Also
GetRecordPos(), SetRecordOffset(), SetRecordPos()
CTRecord.SetBatch
Perform operations on a group of records.
Declaration
void CTRecord.SetBatch(CTBATCH_MODE mode, VRLEN targetLen, VRLEN bufferLen);
Description
CTRecord.SetBatch() attempts to initiate a specified operation on a group of records with keys matching a partial key value, an index range expression, or the entire table by physical order.
The mode parameter specifies which batch operation is to take place. You must choose at least one of the mandatory modes. You may OR in one or more of the optional modes to specify further parameters for the batch operation. Please refer to the description of the modes below.
- targetLen - the number of significant bytes of the partial target key when the batch mode is CTBATCH_GET or CTBATCH_DEL.
- bufferLen - the size of the buffer used internally by FairCom DB API code to handle batch operations. A zero value for this parameter is an indication that the default value size should be used. The default buffer size is calculated as the size of the fixed portion of the record multiplied by 128.
In case of errors, CTRecord.NextBatch() throws a CTException.
Mandatory modes
MODE |
Description |
|---|---|
CTBATCH_GET |
Retrieve a group of related records by partial key |
CTBATCH_RANGE |
Retrieve a group of related records based on an index range expression |
CTBATCH_PHYS |
Retrieve records from a table in physical order. The starting record for the batch retrieval may be specified. |
CTBATCH_DEL |
Delete a group of related records by partial key |
CTBATCH_INS |
Insert a group of records |
Optional modes
Mode |
Description |
|---|---|
CTBATCH_GKEY |
Process records with a greater than or equal key match with the target key. When this mode is specified, the number of matched records is not readily available. ctdbBatchLocked() and CTRecord.BatchLocked() returns a value one greater than ctdbBatchLoaded() to indicate there may be more records to process.This mode is applicable only with CTBATCH_GET and CTBATCH_DEL modes and can not be used with CTBATCH_LKEY. |
CTBATCH_LKEY |
Process records that have a less than or equal key match with the target key.This mode is applicable only with CTBATCH_GET and CTBATCH_DEL modes and can not be used with CTBATCH_GKEY. |
CTBATCH_VERIFY |
Verify that the keys in the index match the values in the key fields of the record. |
CTBATCH_LOCK_KEEP |
Keep all records locked after ...EndBatch() is called. Without this mode, all records locks are released when ...EndBatch() is called. This option is only in effect when used with CTBATCH_LOCK_READ or CTBATCH_LOCK_WRITE. |
CTBATCH_LOCK_READ |
Place a read lock on each record that matches the partial key. |
CTBATCH_LOCK_WRITE |
Place a write lock on each record that matches the partial key. |
CTBATCH_LOCK_BLOCK |
Convert a CTBATCH_LOCK_READ or CTBATCH_LOCK_WRITE to blocking read and blocking write locks, respectively. |
CTBATCH_LOCK_ONE |
Implement an alternative locking strategy: only locks the record during the record read; original locking strategy keeps locks on during entire batch processing. |
CTBATCH_COMPLETE |
...SetBatch() returns a success code only if all matching records are successfully locked. You must specify either CTBATCH_LOCK_READ or CTBATCH_LOCK_WRITE. |
Retrieving records by partial key
All records with key matching a partial target key are loaded into an internally maintained buffer region. If the selected records do not fit in the buffer, those that fit are loaded, and subsequent calls will retrieve the remaining records.
The following steps must be taken to perform a retrieval batch operation based on a partial key:
- Clear a record buffer by calling the CTRecord.Clear() method.
- Use SetFieldValue() or one of the deprecated the CTRecord.SetFieldAs...() methods to set the fields that form the partial target key that will be used to select a group of records.
- Call the CTRecord.SetBatch() method, with CTBATCH_GET mode, to start a new record retrieval batch operation.
- If the CTRecord.SetBatch() method returns with no errors, call the CTRecord.NextBatch() method repeatedly until all related records are retrieved. CTRecord.NextBatch() returns BTMT_ERR (428) to indicate no more records are available.
When you are done with the batch records, call the CTRecord.EndBatch() method to terminate the batch operation. Please note that another batch operation can only start after the current batch operation is terminated.
Retrieving records by index range
All records that match an index range expression are loaded into a buffer region maintained internally by FairCom DB API. If the selected records do not fit in the buffer, those that fit are loaded, and subsequent calls will retrieve the remaining records.
The following steps must be taken to perform an index range batch retrieval of records:
- Establish an index range by calling CTRecord.RangeOn() method;
- Call the CTRecord.SetBatch() method with the CTBATCH_RANGE mode to start a new record retrieval batch operation.
- If the CTRecord.SetBatch() method returns with no errors, call the CTRecord.NextBatch() method repeatedly until all related records are retrieved. CTRecord.NextBatch() returns BTMT_ERR (428) to indicate no more records are available.
- When you are done with the batch records, call the CTRecord.EndBatch() method to terminate the batch operation.
- Call the CTRecord.RangeOff() method to terminate index range operation.
Retrieving records by physical order
All records of a table are loaded by physical order into a buffer region maintained internally by FairCom DB API. If the selected records do not fit in the buffer, those that fit are loaded, and subsequent calls will retrieve the remaining records.
The following steps must be taken to perform a physical order batch retrieval of records:
- Call the CTRecord.SetBatch() method with the CTBATCH_PHYS mode to start a new record retrieval batch operation.
- If the CTRecord.SetBatch() method returns with no errors, call the CTRecordNextBatch() method repeatedly until all related records are retrieved. CTRecord.NextBatch() returns BTMT_ERR (428) to indicate no more records are available.
- When you are done with the batch records, call the CTRecord.EndBatch() method to terminate the batch operation.
Note: Setting a batch with CTBATCH_PHYS will cause slightly different behavior from setting it with CTBATCH_GET.
If the number of records exceeds the size of the buffer set when calling SetBatch, the total returned by BatchTotal will be only the number of records that fit into the batch buffer for CTBATCH_PHYS batches. If the batch was set with the CTBATCH_GET mode, the total number of records satisfying the batch will be returned, regardless if they all fit in the batch buffer. If a precise count of the number of records in a file is necessary, use GetRecordCount when you are in CTBATCH_PHYS mode.
This difference also affects record locking. If the batch was set with CTBATCH_PHYS, the records are locked when they are read into the buffer, so only the records that have been read into the batch buffer are locked. If the batch was set with CTBATCH_GET, all records are locked on the initial call.
Deleting a group of records
If the intended batch operation is to delete a group of selected records, you need to initially set the partial target key to select the group of related records and then start the batch operation to delete the selected records.
Even if no records are retrieved with the delete operation, CTRecord.EndBatch() must be called to terminate the current batch operation.
The following steps must be taken to perform a batch delete record operation:
- Clear a record buffer by calling the CTRecord.Clear() method.
- Use SetFieldValue() or one of the deprecated CTRecord.SetFieldAs...() methods to set the fields that form the partial target key that will be used to select a group of records.
- Call the CTRecord.SetBatch() methods with CTBATCH_DEL mode to delete a group of related records.
- Call the CTRecord.EndBatch() method to terminate the delete record batch operation.
Inserting a group of records
A group of new records are loaded into a buffer region maintained internally by FairCom DB API and this group of records are inserted into a table.
When the batch buffer fills up, the group of records stored in the batch buffer are inserted into the table. If CTRecord.EndBatch() is called and the batch buffer still contains records, a new insert record operation is performed for the remaining records before the batch operation is terminated.
For transaction controlled files, the batch insertion operation is treated as one all or nothing operation. If no explicit transaction is started, each insertion of records with will start and end its own transaction. Even if an explicit transaction is started, each insertion operation is treated independently through safe points.
Note: currently, all records insertion operations will not perform any conversion of records images, key values and records position for heterogeneous client/server implementations.
The following steps must be taken to perform a batch insert record operation:
- Call the CTRecord.SetBatch() method with CTBATCH_INS mode to insert a group of records.
For each record to be inserted perform the following operations:
- call CTRecord.Clear() to initialize a record buffer
- for each field in the record call SetFieldValue() or one of the deprecated CTRecord.SetFieldAs...() method to set the field data;
- call CTRecord.InsertBatch() to insert the record into the batch buffer
- Call CTRecord.EndBatch() to indicate that no more records will be inserted.
Return
void
See Also
CTRecord.BatchLocked(), CTRecord.BatchMode(), CTRecord.EndBatch(), CTRecord.InsertBatch(), CTRecord.IsBatchActive(), CTRecord.NextBatch(), CTRecord.BatchLoaded, CTRecord.BatchTotal
CTRecord.SetDefaultFullTextIndex
Set the new record default Full Text index number.
See CTRecord.SetDefaultFullTextIndex
CTRecord.SetDefaultIndex
Syntax
void SetDefaultIndex(int indexno)
void SetDefaultIndex(String name)
Parameters
- indexno [in] The new default record index number.
- name [in] The new default record index name.
Description
Sets the new record default index. Unless this function is called, the first index is the default.
Return
None.
Example
myRecord->SetDefaultIndex("name");
// change the default index to "name"
myRecord->First();
// find the first record ordered by "name"
See Also
GetDefaultIndex()
CTRecord.SetEdited
Syntax
void SetEdited(bool flag)
Parameters
- flag [in] The new Change Record flag.
Description
Sets the changed record flag.
Return
None.
See Also
IsEdited()
CTRecord.SetFieldAsBigint
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsBigint(int FieldNumber, CTBigint& value)
void SetFieldAsBigint(String FieldName, CTBigint& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The big integer object.
- FieldName [in] The field name.
Description
Sets the field contents as a big integer object (64-bit).
Return
None.
See Also
GetFieldAsBigint(), SetFieldValue()
CTRecord.SetFieldAsBlob
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsBlob (int FieldNumber, CTBlob& value)
void SetFieldAsBlob(String FieldName, CTBlob& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The blob object.
- FieldName [in] The field name.
Description
Sets the field contents as a blob object.
Return
None.
See Also
GetFieldAsBlob(), SetFieldValue()
CTRecord.SetFieldAsBool
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsBool(int FieldNumber, bool value)
void SetFieldAsBool(String FieldName, bool value)
Parameters
- FieldNumber [in] The field number.
- value [in] The boolean value.
- FieldName [in] The field name.
Description
Sets the field contents as a boolean value
Return
None.
See Also
GetFieldAsBool(), SetFieldValue()
CTRecord.SetFieldAsByte
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsByte (int FieldNumber, UTEXT value)
void SetFieldAsByte(String FieldName, UTEXT value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a byte value (unsigned one-byte integer)
Return
None.
See Also
GetFieldAsByte(), SetFieldValue()
CTRecord.SetFieldAsChar
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsChar (int FieldNumber, TEXT value)
void SetFieldAsChar(String FieldName, TEXT value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a TEXT value (signed one-byte integer).
Return
None.
See Also
GetFieldAsChar(), SetFieldValue()
CTRecord.SetFieldAsCurrency
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsCurrency(int FieldNumber, CTCurrency& value)
void SetFieldAsCurrency(String FieldName, CTCurrency& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a CTCurrency (64-bit) object.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsDate
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsDate (int FieldNumber, CTDate& value)
void SetFieldAsDate(String FieldName, CTDate& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a date object.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsDateTime
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsDateTime (int FieldNumber, CTDateTime& value)
void SetFieldAsDateTime(String FieldName, CTDateTime& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a date and time object.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsFloat
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsFloat (int FieldNumber, CTFLOAT value)
void SetFieldAsFloat(String FieldName, CTFLOAT value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a double value.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsMoney
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsMoney (int FieldNumber, CTMoney& value)
void SetFieldAsMoney(String FieldName, CTMoney& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a money object.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsNumber
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsNumber(int FieldNumber, CTNumber& value)
void SetFieldAsNumber (String FieldName, CTNumber& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a CTNumber object.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsShort
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsShort (int FieldNumber, COUNT value)
void SetFieldAsShort(String FieldName, COUNT value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a 2-bytes signed integer (COUNT).
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsSigned
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsSigned (int FieldNumber, CTSigned value)
void SetFieldAsSigned(String FieldName, CTSIGNED value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as an integer signed value.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsString
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsString (int FieldNumber, String value)
void SetFieldAsString( String FieldName, String value)
Parameters
- FieldNumber [in] The field number.
- value [in] The byte value.
- FieldName [in] The field name.
Description
Sets the field contents as a string object.
Return
None.
See Also
GetFieldAsString(), SetFieldValue()
CTRecord.SetFieldAsTime
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsTime (int FieldNumber, CTTime& value)
void SetFieldAsTime(String FieldName, CTTime& value)
Parameters
- FieldNumber [in] The field number.
- value [in] The time object.
- FieldName [in] The field name.
Description
Sets the field contents as a time object.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsUnsigned
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsUnsigned (int FieldNumber, CTUNSIGNED value)
void SetFieldAsUnsigned(String FieldName, CTUNSIGNED value)
Parameters
- FieldNumber [in] The field number.
- value [in] The unsigned integer value.
- FieldName [in] The field name.
Description
Sets the field contents as an integer unsigned value.
Return
None.
See Also
GetFieldAsUnsigned(), SetFieldValue()
CTRecord.SetFieldAsWord
Note: All GetFieldAs... and SetFieldAs... methods are considered obsolete. The suggested replacements are GetFieldValue and SetFieldValue.
Syntax
void SetFieldAsWord (int FieldNumber, UCOUNT value)
void SetFieldAsWord(String FieldName, UCOUNT value)
Parameters
- FieldNumber [in] The field number.
- value [in] The UCOUNT value.
- FieldName [in] The field name.
Description
Sets the field contents as an unsigned two-byte integer (UCOUNT) value.
Return
None.
See Also
GetFieldAsWord(), SetFieldValue()
CTRecord.SetFieldValue
Syntax
void SetFieldValue(int FieldNumber, bool value)
void SetFieldValue(String FieldName, bool value)
void SetFieldValue(int FieldNumber, int value)
void SetFieldValue(String FieldName, int value)
void SetFieldValue(int FieldNumber, uint value)
void SetFieldValue(String FieldName, uint value)
void SetFieldValue(int FieldNumber, long value)
void SetFieldValue(String FieldName, long value)
void SetFieldValue(int FieldNumber, double value)
void SetFieldValue(String FieldName, double value)
void SetFieldValue(int FieldNumber, string value)
void SetFieldValue(String FieldName, string value)
void SetFieldValue(int FieldNumber, byte[] value)
void SetFieldValue(String FieldName, byte[] value)
void SetFieldValue(int FieldNumber, CTBlob value)
void SetFieldValue(String FieldName, CTBlob value)
void SetFieldValue(int FieldNumber, CTNumber value)
void SetFieldValue(String FieldName, CTNumber value)
void SetFieldValue(int FieldNumber, CTDate value)
void SetFieldValue(String FieldName, CTDate value)
void SetFieldValue(int FieldNumber, CTTime value)
void SetFieldValue(String FieldName, CTTime value)
void SetFieldValue(int FieldNumber, CTDateTime value)
void SetFieldValue(String FieldName, CTDateTime value)
void SetFieldValue(int FieldNumber, DateTime value)
void SetFieldValue(String FieldName, DateTime value)
void SetFieldValue(int FieldNumber, CTMoney value)
void SetFieldValue(String FieldName, CTMoney value)
void SetFieldValue(int FieldNumber, CTCurrency value)
void SetFieldValue(String FieldName, CTCurrency value)
Parameters
- FieldNumber [in] - The field number.
- FieldName [in] - The field name.
- value [in] The value to store in the field.
Description
Sets the field contents. The suggested methods for setting field values are as follows:
SetFieldValue(String fieldName, anytype Value);
and
SetFieldValue(int fieldNumber, anytype Value);
- anytype means that these methods are overloaded to accept the needed types as shown above under Syntax.
- Either fieldName or fieldNumber can be used to specify the field.
For example, to set a filed to a Bool value of true, use either:
SetFieldValue(fieldName, true);
or
SetFieldValue(fieldNumber, true);
Return
None.
See Also
CTRecord.SetFilter
SYNTAX
void SetFilter(String cndexpr)
PARAMETERS
- cndexpr [in] the filtering expression. The valid expressions are shown in the table below.
int atoi( char* String ) |
ASCII to integer. |
int atol( char* String ) |
ASCII to long. |
double atof( char* String ) |
ASCII to float. |
int cabs( into Value ) |
Calculate the absolute value of a complex number. |
int labs( into Value ) |
Calculate the absolute value of a long integer. |
double fabs( double Value ) |
Calculate the absolute value of a float. |
double ceil( double Value ) |
Calculate the ceiling of a value. |
double floor( double Value ) |
Calculate the floor of a value. |
double fmod( double r, double t ) |
Calculate the floating-point remainder. |
int strlen( char* String ) |
Get the length of a string. |
int strcmp( char* s, char* t ) |
Compare strings. |
int stricmp( char* s, char* t ) |
Compare strings without regard to case. |
int strncmp( char* s, char* t, int length ) |
Compare characters of two strings. |
int strnicmp( char* s, char *t, int length ) |
Compare characters of two strings without regard to case. |
DESCRIPTION
SetFilter is used to set the filtering for a record. When set, all records retrieved from the table will be filtered against the expression, and just those records that match this criteria will be returned. Notice that this feature will be temporary, and just the user who sets the filter will have its records filtered. The filter is turned off when the table is closed, or when SetFilter() is called with NULL in the parameter cndexpr. If a new expression is set to a record with a current filter, the old filter is replaced with the new one. Only one filter may be active per record per user at a given time.
When used in the client/server model, this feature has the potential to increase the performance because only the records matching the criteria will be returned, reducing the network traffic. If used in conjunction with sets (CTRecord.RecordSetOn), it it may behave as a simple query.
RETURN
None.
SEE ALSO
GetFilter(), IsFiltered()
CTRecord.SetNew
Syntax
void SetNew(bool flag)
Parameters
- flag [in] The new Record flag.
Description
Sets the new record flag.
Return
None.
See Also
IsNew()
CTRecord.SetRecordOffset
Syntax
void SetRecordOffset(CTOFFSET offset)
Parameters
- offset [in] The record offset position.
Description
Updates the record offset. The current record pointer is not moved and no record data is updated.
Return
None.
See Also
GetRecordPos(), SeekRecord(), SetRecordPos()
CTRecord.SetRecordPos
Syntax
void SetRecordPos(CTOFFSET offset)
Parameters
- offset [in] The record offset.
Description
Sets the current record offset position. The record buffers are not updated. In order to update the record buffer, Read must be called.
Return
None.
See Also
GetRecordPos(), Read(), SeekRecord(), SetRecordOffset()
CTRecord.SwitchContext
Syntax
void SwitchContext( )
Parameters
None.
Description
Force a switch to the c-tree ISAM context indicated by the record object. Each record object has its own c-tree ISAM context id.
When most FairCom DB API record handling functions are called, they automatically perform a c-tree ISAM context switch.
SwitchContext() may be useful before calling specific c-tree ISAM or low level calls to make sure the correct ISAM context is active before making those calls.
Return
None.
See Also
CTTable.UnlockTable(), LockRecord()
CTRecord.UnlockRecord
Syntax
void UnlockRecord( )
Parameters
None.
Description
Unlocks the current record. To free all record locks from one specific table obtained with LockRecord(), use CTTable.UnlockTable().
Return
None.
See Also
CTTable.UnlockTable(), LockRecord(), Locking
CTRecord.Write
Syntax
void Write( )
Parameters
This method has no parameters.
Description
Writes the record buffer to disk. In multi-user environments, the record should be locked before an update.
Return
None.
See Also
Clear(), CTBase.Lock(), Delete(), LockRecord(), Read(), Reset()