Class CTTable
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCTTable
(CTDatabase Handle) Constructor for the CTTable class based on a givenCTDatabase
object.CTTable
(CTHANDLE Handle) Constructor for the CTTable class based on a given CTHANDLE.Constructor for the CTTable class based on a givenCTSession
object. -
Method Summary
Modifier and TypeMethodDescriptionAdds a new field to the current table.AddFullTextIndex
(String name) Add a new index to the tableAdds a new index to the current table.void
AddMRTTable
(CTDatabase database, String Name, String ParentName, int Info) Adds an existing MRTTable definition to the database dictionary.AddSegment
(int IndexNbr, int FieldNbr, int SegMode) Adds a new segment to an index.AddSegment
(int IndexNbr, CTField Field, int SegMode) Adds a new segment to an index.AddSegment
(int IndexNbr, String FieldName, int SegMode) Adds a new segment to an index.AddSegment
(CTIndex Index, int FieldNumber, int SegMode) Adds a new segment to an index.AddSegment
(CTIndex Index, int offset, int length, int SegMode) Adds a new segment to an index.AddSegment
(CTIndex Index, CTField Field, int SegMode) Adds a new segment to an index.AddSegment
(CTIndex Index, String FieldName, int SegMode) Adds a new segment to an index.AddSegment
(String IndexName, int FieldNumber, int SegMode) Adds a new segment to an index.AddSegment
(String IndexName, CTField Field, int SegMode) Adds a new segment to an index.AddSegment
(String IndexName, String FieldName, int SegMode) Adds a new segment to an index.void
Alter
(int Action) Perform alter table functions.void
Attach
(int datno) Attaches a c-tree Plus ISAM datno object to a CTTable object.void
Clears the default value associated with all fields in a table.void
Creates a new table based on the current one.void
Close()
Closes the current table.void
Compact()
Builds data and index files.void
Creates a new table.void
CreateMRTTable
(String Name, String ParentName, int CreateMode, String Filter) Creates a new MRTTable based on a host table..CreateResultSet
(String Name) Creates aCTResultSet
object for the current table.void
DeleteField
(int FieldNumber) Deletes a field from the current table.void
DeleteField
(String FieldName) Deletes a field from the table.void
DelFullTextIndex
(int indexNumber) Delete a Full Text index from a tablevoid
DelFullTextIndex
(String indexName) Delete a full text index from a tablevoid
DelIndex
(int IndexNumber) Deletes an index from the current table.void
Deletes an index from a table.void
DelSegment
(int IndexNumber, int SegNumber) Deletes an existing segment.void
DelSegment
(String IndexName, int SegNumber) Deletes an existing segment.void
Detach()
Detaches a c-treeDB table object from c-tree data and index files.void
FilterRecord
(String cndexpr) Sets or clears record filter condition.void
finalize()
Destroys an allocated CTTable object.int
GetBinaryFlag
(int FieldNumber) Retrieves the fieldBINARY_FLAG
.int
GetBinaryFlag
(String FieldName) Retrieves the fieldBINARY_FLAG
.GetCndxIndex
(int Indexnbr) Retrieves the index conditional expression by index number.GetCndxIndex
(String indexname) Retrieves the index conditional expression by index name.int
Retrieves the tableCREATE_MODE
.int
Retrieves the c-tree data file default extent size.Gets the data file name extension.int
GetDatno()
Retrieves the table data file number.char
Retrieves the table field delimiter character.GetField
(int FieldNumber) Retrieves a field by its number.Retrieves a field by its name.int
Retrieves the number of fields in the table.int
GetFieldNumber
(String FieldName) Retrieves the field number from the current table, given its field name.Retrieves the current filter expression for the table.GetFullTextIndex
(int indexNumber) Retrieve a Full Text index objectGetFullTextIndex
(String name) Retrieve the Full Text index given its nameint
Retrieve the number of full text indices of this tableRetrieves the table group id.Retrieves the name of the Identity field.long
Retrieves the increment value of the Identity field.long
Retrieves the seed value of the Identity field.int
GetIdxno
(int Index) Retrieves the index file number by the index number.int
Retrieves the index file number by the index name.GetIndex
(int IndexNumber) Retrieves an index handle by its number in the current table.Retrieves the index by its name.GetIndexByUID
(int uid) Retrieves an index object given its UID - internal Unique Identification.int
Retrieves the number of indices in the current table.int
Retrieves the c-tree index file default extent size.Gets the index file name extension.GetIndexFilename
(int IndexNumber) Retrieves the index file name.GetIndexFilename
(String IndexName) Retrieves the index file name.long
Retrieves the next identity value.GetName()
Gets the table name, without the name extension.int
Retrieves the tableOPEN_MODE
.GetOwner()
Retrieves the current table owner.char
Retrieves the table pad character.int
Retrieve the number of the partition indexRetrieves the table password.GetPath()
Gets the table path.int
Retrieves the table permission mask.GetResultSetByName
(String Name) Retrieves theCTResultSet
for the current table by its name.GetSegment
(CTIndex Index, int SegNumber) Retrieves an index segment object by its number.int
Retrieves currentTABLE_STATUS
.long
Retrieves the number assigned to a virtual table.boolean
Indicates if a table has the $DELFLD$ internal field.boolean
HasLocks()
Check if there is any lock acquired on the table in the current session.boolean
Indicates if a table has null field support.boolean
Indicates if a table was created with recbyt index.boolean
HasRowid()
Indicates if a table was created with rowid index.InsertField
(int BeforeField, String Name, int Type, int Length) Inserts a new field into the current table, in the specified position.InsertField
(String BeforeField, String Name, int Type, int Length) Inserts a new field into the current table, in the specified position.InsertSegment
(int IndexNbr, int BeforeSegment, int FieldNumber, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(int IndexNbr, int BeforeSegment, CTField Field, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(int IndexNbr, int BeforeSegment, String FieldName, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(CTIndex Index, int BeforeSegment, int FieldNumber, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(CTIndex Index, int BeforeSegment, int offset, int length, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(CTIndex Index, int BeforeSegment, CTField Field, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(CTIndex Index, int BeforeSegment, String FieldName, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(String IndexName, int BeforeSegment, int FieldNumber, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(String IndexName, int BeforeSegment, CTField Field, int SegMode) Inserts a new segment to an index in a given position.InsertSegment
(String IndexName, int BeforeSegment, String FieldName, int SegMode) Inserts a new segment to an index in a given position.boolean
IsActive()
Checks if a table is active.boolean
Checks if the current table has a record filter active.boolean
IsVTable()
Check if a table is a virtual table or a regular table.void
MoveField
(int FieldNumber, int newNumber) Moves the field to a new position in the current tablevoid
Moves the field to a new position in the current table.void
MoveSegment
(int indexNumber, int segNumber, int newIndex) Moves a segment to another position.void
MoveSegment
(CTIndex hIndex, int segNumber, int newIndex) Moves a segment to another position.void
MoveSegment
(String indexName, int segNumber, int newIndex) Moves a segment to another position.long
NumberOfKeyEntries
(int index) Retrieves the number of key entries in a index file.long
NumberOfKeyEntries
(String indexName) Retrieves the number of key entries in an index file.void
Opens an existing table for the current object.int
PartAdminByName
(String PartName, int PartMode) Performs a partition operation on the partition specified by name.int
PartAdminByNumber
(int Prawno, int PartMode) Performs a partition operation on the partition specified by raw partition number.void
Rebuild
(int Mode) Builds data and index files.void
Remove()
Deletes the current table.void
RemoveVTableResource
(CTTable Parent, int Number) Removes a virtual table resource.void
ResetAll()
Reset all active record buffers associated with table.void
SetBinaryFlag
(int FieldNumber, int Flag) Sets the fieldBINARY_FLAG
.void
SetBinaryFlag
(String FieldName, int Flag) Sets the fieldBINARY_FLAG
.void
SetDataDefaultExtentSize
(int size) Sets the c-tree data file default extent sizevoid
SetDataExtension
(String Ext) Sets the table data extension.void
SetFullTextIndexOption
(int indexNbr, int option, String svalue, int ivalue) Set Full Text index optionsvoid
SetFullTextIndexOption
(CTFullTextIndex pIndex, int option, String svalue, int ivalue) Set Full Text index optionsvoid
SetFullTextIndexOption
(String indexName, int option, String svalue, int ivalue) Set Full Text index optionsvoid
SetGroupid
(String Groupid) Sets the table group id.void
SetIdentityField
(String FieldName, long Seed, long Increment) Sets the identity field.void
SetIndexDefaultExtentSize
(int size) Sets the c-tree index file default extent sizevoid
SetIndexExtension
(String Ext) Sets the table index extension.void
SetIndexFilename
(int IndexNumber, String Path, String Filename) Sets the index file name.void
SetIndexFilename
(String IndexName, String Path, String Filename) Sets the index file name.void
SetMRTTableFilter
(String Condition) Sets filter information in the virtual table handle.void
Sets the table owner.void
SetPadChar
(char Padchar, char Dlmchar) Sets the table pad and field delimiter characters in the table handle.void
SetPassword
(String Password) Sets the table password.void
Sets the table path.void
SetPermission
(int Permmask) Sets the table permission mask.void
Releases all record locks associated with the current table.void
UpdateCndxIndex
(int indexnbr, String cndexpr) Add, modify or delete conditional index by number.void
UpdateCndxIndex
(String Indexname, String Cndexpr) Add, modify or delete conditional index by name.void
UpdateCreateMode
(int mode) Updates the table create mode.void
UpdatePadChar
(char Padchar, char Dmlchar, boolean Rebuild) Updates the table pad and delimiter character resource.Methods inherited from class CTBase
Abort, Begin, ClearSavePoint, Commit, GetAutoCommit, GetHandle, GetKeepLock, GetLockMode, GetOperation, GetTransactionMode, IsLockActive, IsTransActive, IsUnicodeLib, Lock, PrepareCommit, RestoreSavePoint, SetAutoCommit, SetHandle, SetKeepLock, SetOperation, SetSavePoint, SetTransactionMode, Unlock
-
Constructor Details
-
CTTable
Constructor for the CTTable class based on a given CTHANDLE.- Parameters:
Handle
- Table handle for which the CTTable is created.- Throws:
CTException
- in case of error- See Also:
-
CTTable
Constructor for the CTTable class based on a givenCTDatabase
object.- Parameters:
Handle
- ExistingCTDatabase
object for which the CTTable is created.- Throws:
CTException
- in case of error- See Also:
-
CTTable
Constructor for the CTTable class based on a givenCTSession
object.- Parameters:
Handle
- ExistingCTSession
object for which the CTTable is created.- Throws:
CTException
- in case of error- See Also:
-
-
Method Details
-
finalize
public void finalize()Destroys an allocated CTTable object. This method should be called in order to avoid memory leaks. Releases all resources associated with a table. -
Open
Opens an existing table for the current object.- Parameters:
Name
- Table name to be opened.OpenMode
-OPEN_MODE
to be used.- Throws:
CTException
- in case of error- See Also:
-
Close
Closes the current table.- Throws:
CTException
- in case of error- See Also:
-
IsActive
public boolean IsActive()Checks if a table is active. A table is active if it is open.- Returns:
- true if the table is active, false otherwise.
- See Also:
-
GetName
Gets the table name, without the name extension.- Returns:
- Current table name.
- Throws:
CTException
- in case of error- See Also:
-
GetPath
Gets the table path.- Returns:
- Current table path.
- See Also:
-
GetDataExtension
Gets the data file name extension. If not changed bySetDataExtension(java.lang.String)
, the data extension is "dat"- Returns:
- Current data file name extension.
- Throws:
CTException
- in case of error- See Also:
-
GetIndexExtension
Gets the index file name extension. If not changed bySetIndexExtension(java.lang.String)
, the index extension is "idx"- Returns:
- Current index file name extension.
- Throws:
CTException
- in case of error- See Also:
-
GetOpenMode
public int GetOpenMode()Retrieves the tableOPEN_MODE
.- Returns:
- Current
OPEN_MODE
value. - See Also:
-
GetCreateMode
public int GetCreateMode()Retrieves the tableCREATE_MODE
.- Returns:
- Current
CREATE_MODE
value. - See Also:
-
GetDataDefaultExtentSize
public int GetDataDefaultExtentSize()Retrieves the c-tree data file default extent size.- Returns:
- Default data file extent size. The default value, 8192 bytes, may
be changed by calling
SetDataDefaultExtentSize(int)
. - See Also:
-
GetIndexDefaultExtentSize
public int GetIndexDefaultExtentSize()Retrieves the c-tree index file default extent size.- Returns:
- Default index file extent size. The default value, 8192 bytes,
may be changed by calling
SetIndexDefaultExtentSize(int)
. - See Also:
-
GetPassword
Retrieves the table password.- Returns:
- Current table password.
- See Also:
-
GetGroupid
Retrieves the table group id.- Returns:
- Current table group id.
- See Also:
-
GetPermission
public int GetPermission()Retrieves the table permission mask.- Returns:
- Current table permission mask.
- See Also:
-
SetPath
Sets the table path.- Parameters:
Path
- New table path value.- Throws:
CTException
- in case of error- See Also:
-
SetDataExtension
Sets the table data extension.- Parameters:
Ext
- New table data extension.- Throws:
CTException
- in case of error- See Also:
-
SetIndexExtension
Sets the table index extension.- Parameters:
Ext
- New index data extension.- Throws:
CTException
- in case of error- See Also:
-
SetDataDefaultExtentSize
Sets the c-tree data file default extent sizeEach time the data file needs to be extended, it will use this value to extent the file. If not changed by SetDataDefaultExtentSize(), this value is 8192 bytes
- Parameters:
size
- New default data extent size.- Throws:
CTException
- in case of error- See Also:
-
SetIndexDefaultExtentSize
Sets the c-tree index file default extent sizeEach time the index file needs to be extended, it will use this value to extent the file. If not changed by SetDataDefaultExtentSize(), this value is 8192 bytes.
- Parameters:
size
- New default index extent size.- Throws:
CTException
- in case of error- See Also:
-
SetPassword
Sets the table password.- Parameters:
Password
- New table password.- Throws:
CTException
- in case of error- See Also:
-
SetGroupid
Sets the table group id.- Parameters:
Groupid
- New table group id.- Throws:
CTException
- in case of error- See Also:
-
SetPermission
Sets the table permission mask.- Parameters:
Permmask
- New table permission mask.- Throws:
CTException
- in case of error- See Also:
-
Create
Creates a new table. Before the table creation, it must be defined withAddField(java.lang.String, int, int)
, and optionally withAddIndex(java.lang.String, int, boolean, boolean)
andAddSegment(FairCom.CtreeDb.CTIndex, FairCom.CtreeDb.CTField, int)
.- Parameters:
Name
- New table name.CreateMode
-CREATE_MODE
to be used.- Throws:
CTException
- in case of error- See Also:
-
GetFieldCount
public int GetFieldCount()Retrieves the number of fields in the table.- Returns:
- Current number of fields.
- See Also:
-
AddField
Adds a new field to the current table.- Parameters:
Name
- New field name.Type
- NewFIELD_TYPE
.Length
- New field length, the maximum length of [VAR]CHAR or [VAR]BINARY field in bytes (64K max). Set to 0 for "unlimited" (2GB) LVARCHAR.- Returns:
- The new
CTField
object on success or null on failure. - Throws:
CTException
- in case of error- See Also:
-
InsertField
Inserts a new field into the current table, in the specified position.- Parameters:
BeforeField
- Insert the new field before this field number.Name
- New field name.Type
- NewFIELD_TYPE
.Length
- New field length.- Returns:
- The new
CTField
object on success or null on failure. - Throws:
CTException
- in case of error- See Also:
-
InsertField
public CTField InsertField(String BeforeField, String Name, int Type, int Length) throws CTException Inserts a new field into the current table, in the specified position.- Parameters:
BeforeField
- Insert the new field before this field name.Name
- New field name.Type
- NewFIELD_TYPE
.Length
- New field length.- Returns:
- The new
CTField
object on success or null on failure. - Throws:
CTException
- in case of error- See Also:
-
DeleteField
Deletes a field from the current table.- Parameters:
FieldNumber
- Field number to be deleted.- Throws:
CTException
- in case of error- See Also:
-
DeleteField
Deletes a field from the table.- Parameters:
FieldName
- Field name to be deleted.- Throws:
CTException
- in case of error- See Also:
-
MoveField
Moves the field to a new position in the current table- Parameters:
FieldNumber
- Current field number.newNumber
- New field number.- Throws:
CTException
- in case of error- See Also:
-
MoveField
Moves the field to a new position in the current table.- Parameters:
FieldName
- Field name to be moved.newNumber
- New field number.- Throws:
CTException
- in case of error- See Also:
-
GetField
Retrieves a field by its number.- Parameters:
FieldNumber
- Field number to be retrieved.- Returns:
CTField
object found.- Throws:
CTException
- in case of error- See Also:
-
GetField
Retrieves a field by its name.- Parameters:
FieldName
- Field name to be retrieved.- Returns:
CTField
object found.- Throws:
CTException
- in case of error- See Also:
-
GetFieldNumber
Retrieves the field number from the current table, given its field name.- Parameters:
FieldName
- Field name to be retrieved.- Returns:
- Field number.
- Throws:
CTException
- in case of error- See Also:
-
GetIndexCount
public int GetIndexCount()Retrieves the number of indices in the current table.- Returns:
- Current number of indices.
- See Also:
-
AddIndex
public CTIndex AddIndex(String Name, int KeyType, boolean AllowDuplicates, boolean NullFlag) throws CTException Adds a new index to the current table.- Parameters:
Name
- New index name.KeyType
- New indexKEY_TYPE
value.AllowDuplicates
- Boolean indicating if index allows duplicate keys.NullFlag
- Boolean indicating if index allows null keys.- Returns:
- New
CTIndex
object. - Throws:
CTException
- in case of error- See Also:
-
AddMRTTable
public void AddMRTTable(CTDatabase database, String Name, String ParentName, int Info) throws CTException Adds an existing MRTTable definition to the database dictionary.- Parameters:
database
- The database handleName
- The table nameParentName
- The host table nameInfo
- The MRTTable definition number- Throws:
CTException
- in case of error
-
GetVTableNumber
public long GetVTableNumber()Retrieves the number assigned to a virtual table.- Returns:
- The number assigned to a virtual table.
-
IsVTable
public boolean IsVTable()Check if a table is a virtual table or a regular table.- Returns:
- YES if the table is a Virtual Table, NO otherwise.
-
RemoveVTableResource
Removes a virtual table resource.- Parameters:
Parent
- Host table to which the virtual table is assigned.Number
- Number of the virtual table.- Throws:
CTException
- in case of error
-
SetMRTTableFilter
Sets filter information in the virtual table handle.- Parameters:
Condition
- Filter condition.- Throws:
CTException
- in case of error
-
DelIndex
Deletes an index from the current table.- Parameters:
IndexNumber
- The number of the index to be deleted.- Throws:
CTException
- in case of error- See Also:
-
DelIndex
Deletes an index from a table.- Parameters:
IndexName
- Index name to be deleted.- Throws:
CTException
- in case of error- See Also:
-
GetIndex
Retrieves an index handle by its number in the current table.- Parameters:
IndexNumber
- Index number in the table.- Returns:
- Found
CTIndex
object. - Throws:
CTException
- in case of error- See Also:
-
GetIndex
Retrieves the index by its name.- Parameters:
name
- Index name.- Returns:
- Found
CTIndex
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
Index
-CTIndex
to be modified.Field
-CTField
to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
Index
-CTIndex
to be modified.FieldName
- Field name to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
Index
-CTIndex
to be modified.FieldNumber
- Field number to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
Index
-CTIndex
to be modified.offset
- Absolute byte offset to be set in the new segment.length
- Segment length in bytes.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
IndexNbr
- Index number to be modified.FieldNbr
- Field number to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
IndexNbr
- Index number to be modified.FieldName
- Field name to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
IndexNbr
- Index number to be modified.Field
-CTField
to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
IndexName
- Index name to be modified.FieldName
- Field name to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
IndexName
- Index name to be modified.FieldNumber
- Field number to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
AddSegment
Adds a new segment to an index.- Parameters:
IndexName
- Index name to be modified.Field
-CTField
to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Added
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(CTIndex Index, int BeforeSegment, CTField Field, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
Index
-CTIndex
to be modified.BeforeSegment
- Insert the segment before this existing segment.Field
-CTField
to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(CTIndex Index, int BeforeSegment, String FieldName, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
Index
-CTIndex
to be modified.BeforeSegment
- Insert the segment before this existing segment.FieldName
- Field name to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(CTIndex Index, int BeforeSegment, int FieldNumber, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
Index
-CTIndex
to be modified.BeforeSegment
- Insert the segment before this existing segment.FieldNumber
- Field number to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(CTIndex Index, int BeforeSegment, int offset, int length, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
Index
-CTIndex
to be modified.BeforeSegment
- Insert the segment before this existing segment.offset
- Segment absolute offset.length
- Segment length in bytes.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(int IndexNbr, int BeforeSegment, int FieldNumber, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
IndexNbr
- Index number to be modified.BeforeSegment
- Insert the segment before this existing segment.FieldNumber
- Field number to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(int IndexNbr, int BeforeSegment, String FieldName, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
IndexNbr
- Index number to be modified.BeforeSegment
- Insert the segment before this existing segment.FieldName
- Field name to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(String IndexName, int BeforeSegment, String FieldName, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
IndexName
- Index name to be modified.BeforeSegment
- Insert the segment before this existing segment.FieldName
- Field name to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(String IndexName, int BeforeSegment, int FieldNumber, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
IndexName
- Index name to be modified.BeforeSegment
- Insert the segment before this existing segment.FieldNumber
- Field number to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(String IndexName, int BeforeSegment, CTField Field, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
IndexName
- Index name to be modified.BeforeSegment
- Insert the segment before this existing segment.Field
-CTField
to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
InsertSegment
public CTSegment InsertSegment(int IndexNbr, int BeforeSegment, CTField Field, int SegMode) throws CTException Inserts a new segment to an index in a given position.- Parameters:
IndexNbr
- Index number to be modified.BeforeSegment
- Insert the segment before this existing segment.Field
-CTField
to be set in the new segment.SegMode
-SEG_MODE
to be used in the new segment.- Returns:
- Inserted
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
DelSegment
Deletes an existing segment.- Parameters:
IndexNumber
- Index number to be modified.SegNumber
- Segment number to be deleted.- Throws:
CTException
- in case of error- See Also:
-
DelSegment
Deletes an existing segment.- Parameters:
IndexName
- Index name to be modified.SegNumber
- Segment number to be deleted.- Throws:
CTException
- in case of error- See Also:
-
GetSegment
Retrieves an index segment object by its number.- Parameters:
Index
-CTIndex
to be checked.SegNumber
- Segment number.- Returns:
- Found
CTSegment
object. - Throws:
CTException
- in case of error- See Also:
-
Alter
Perform alter table functions.- Parameters:
Action
-ALTER_TABLE
action to be taken.- Throws:
CTException
- in case of error- See Also:
-
ResetAll
Reset all active record buffers associated with table.- Throws:
CTException
- in case of error
-
HasNullFieldSupport
public boolean HasNullFieldSupport()Indicates if a table has null field support.- Returns:
- true if the table has null field support, otherwise false.
- See Also:
-
GetIndexByUID
Retrieves an index object given its UID - internal Unique Identification.- Parameters:
uid
- Unique Identification in the database.- Returns:
- Found
CTIndex
object. - Throws:
CTException
- in case of error- See Also:
-
HasRecbyt
public boolean HasRecbyt()Indicates if a table was created with recbyt index.- Returns:
- true if table has recbyt index, false otherwise.
- See Also:
-
HasRowid
public boolean HasRowid()Indicates if a table was created with rowid index.- Returns:
- true if table has rowid index, false otherwise.
- See Also:
-
UnlockTable
Releases all record locks associated with the current table.- Throws:
CTException
- in case of error
-
UpdateCndxIndex
Add, modify or delete conditional index by number.- Parameters:
indexnbr
- Index number to be modified.cndexpr
- New conditional expression.- Throws:
CTException
- in case of error- See Also:
-
UpdateCndxIndex
Add, modify or delete conditional index by name.- Parameters:
Indexname
- Index name to be modified.Cndexpr
- index conditional expression.- Throws:
CTException
- in case of error- See Also:
-
GetCndxIndex
Retrieves the index conditional expression by index number.- Parameters:
Indexnbr
- Index number to be checked.- Returns:
- Conditional index expression.
- Throws:
CTException
- in case of error- See Also:
-
GetCndxIndex
Retrieves the index conditional expression by index name.- Parameters:
indexname
- Index name to be checked.- Returns:
- Conditional index expression.
- Throws:
CTException
- in case of error- See Also:
-
FilterRecord
Sets or clears record filter condition. If a filter is set, all record reads will evaluate the conditional expression against the record data. If the result is false the record is skipped. The filter condition remains in place until the table is closed or replaced by another conditional expression. Pass an empty String to switch off the current filter state.- Parameters:
cndexpr
- Conditional expression used to filter the records. Pass an empty String to switch off the filter state.- Throws:
CTException
- in case of error- See Also:
-
IsFilteredRecord
Checks if the current table has a record filter active.- Returns:
- Returns true if a filter is active, false otherwise.
- Throws:
CTException
- in case of error- See Also:
-
GetFilter
Retrieves the current filter expression for the table.- Returns:
- Record filter expression.
- Throws:
CTException
- in case of error- See Also:
-
UpdateCreateMode
Updates the table create mode.- Parameters:
mode
- New tableCREATE_MODE
value.- Throws:
CTException
- in case of error- See Also:
-
GetPadChar
Retrieves the table pad character. This character is used to pad fixed String fields (CT_FSTRING) to allow proper target key formation.- Returns:
- Current pad character.
- Throws:
CTException
- in case of error- See Also:
-
GetDlmChar
Retrieves the table field delimiter character. This character is used to pad fixed String fields (CT_FSTRING) to allow proper target key formation.- Returns:
- Field delimiter character.
- Throws:
CTException
- in case of error- See Also:
-
SetPadChar
Sets the table pad and field delimiter characters in the table handle. These characters are used to pad fixed String fields (CT_FSTRING) to allow proper target key formation.- Parameters:
Padchar
- New pad character.Dlmchar
- New field delimiter character.- Throws:
CTException
- in case of error- See Also:
-
UpdatePadChar
Updates the table pad and delimiter character resource. The table must be opened exclusive to allow update of the resource.- Parameters:
Padchar
- New pad character.Dmlchar
- New field delimiter character.Rebuild
- Indicate if the table should be rebuilt. If rebuild is set to true, every record is read and the fixed String fields (CT_FSTRING) are padded according to new padding strategy.- Throws:
CTException
- in case of error- See Also:
-
HasDelField
public boolean HasDelField()Indicates if a table has the $DELFLD$ internal field.- Returns:
- True if the table has $DELFLD$ field or false if the table has no $DELFLD$ field or if the handle is invalid (not allocated, the table is not opened, is not a table handle, etc).
- See Also:
-
SetIndexFilename
Sets the index file name.- Parameters:
IndexNumber
- Index number to be modified.Path
- Index path. If NULL use the table path.Filename
- Index file name. If NULL use the table name.- Throws:
CTException
- in case of error- See Also:
-
SetIndexFilename
Sets the index file name.- Parameters:
IndexName
- Index name to be modified.Path
- Index path. If NULL use the table path.Filename
- index file name. If NULL use the table name.- Throws:
CTException
- in case of error- See Also:
-
GetIndexFilename
Retrieves the index file name.- Parameters:
IndexNumber
- Index number to be checked.- Returns:
- Current index file name. If Index name is null the returned String will be cleared.
- Throws:
CTException
- in case of error- See Also:
-
GetIndexFilename
Retrieves the index file name.- Parameters:
IndexName
- Index name to be checked.- Returns:
- Current index file name. If Index name is NULL the returned String will be cleared.
- Throws:
CTException
- in case of error- See Also:
-
GetDatno
Retrieves the table data file number.- Returns:
- Table data file number.
- Throws:
CTException
- in case of error- See Also:
-
GetIdxno
Retrieves the index file number by the index number.- Parameters:
Index
- Index number. The first index number is zero.- Returns:
- Index file number.
- Throws:
CTException
- in case of error- See Also:
-
GetIdxno
Retrieves the index file number by the index name.- Parameters:
IndexName
- Index name.- Returns:
- Index file number.
- Throws:
CTException
- in case of error- See Also:
-
Remove
Deletes the current table. If the table was open under a database, the table is first dropped from the database and then deleted from disc.- Throws:
CTException
- in case of error- See Also:
-
ClearAllFieldDefaultValue
Clears the default value associated with all fields in a table. The default date and time types for each field are also reset to the default values of CTDATE_MDCY and CTIME_HMS respectively.- Throws:
CTException
- in case of error
-
GetStatus
public int GetStatus()Retrieves currentTABLE_STATUS
. The table status indicate which rebuild action will be taken by an alter table operation.For example, to check if a table needs to rebuild all indexes or perform a full rebuild, the following code can be used:
int status = hTable.GetStatus(); if ((status & TABLE_STATUS.REBUILD_ALL)!=0) || ((status & TABLE_STATUS.REBUILD_FULL)!=0) hTable.Alter(ALTER_FULL); else if (status) hTable.Alter(ALTER_NORMAL);
- Returns:
- Current
TABLE_STATUS
value. - See Also:
-
GetOwner
Retrieves the current table owner. If the table owner was not previously set bySetOwner(java.lang.String)
, GetOwner returns an empty string.- Returns:
- Table owner or empty string if no table owner is set.
- See Also:
-
SetOwner
Sets the table owner. You should set the table owner before the table is created to allow the proper c-tree security setting to table place.- Parameters:
owner
- New table owner. If owner is an empty string the table owner will be cleared.- Throws:
CTException
- in case of error- See Also:
-
Rebuild
Builds data and index files. You must open the table before Rebuild() is executed. If the table is corrupt, open the table with CTOPEN_CORRUPT mode and then call Rebuild() to rebuild the data and index files. If there are missing index files, open the table with CTOPEN_DATAONLY mode and Rebuild() will reconstruct the missing index files.The following steps are performed during the table rebuild process:
1. If a transaction is active, and the table being rebuild was created with CTCREATE_TRNLOG or CTCREATE_PREIMG, the transaction is committed before the table is rebuilt, and the transaction is restarted after the table rebuild process is terminated.
2. The update corrupt flag 'updflg' of the header of the data file is cleared.
3. The internal delete stack chain of fixed-length data files or the internal delete management index of variable length data files are rebuilt.
4. The existing index files are removed and new index files are rebuilt over the existing files, optimized for both size and speed.
- Parameters:
Mode
-REBUILD_MODE
to be used in this execution.- Throws:
CTException
- in case of error- See Also:
-
Compact
Builds data and index files. You must open the table before Compact() is executed.- Throws:
CTException
- in case of error- See Also:
-
Attach
Attaches a c-tree Plus ISAM datno object to a CTTable object. This method is useful if you have opened a data and index file using one of c-tree's ISAM open functions and need to attach it to a CTTable object to use some of the advanced c-treeDB C++ features such as alter table or the CTRecord object.- Parameters:
datno
- New data file number.- Throws:
CTException
- in case of error- See Also:
-
Detach
Detaches a c-treeDB table object from c-tree data and index files. The c-tree ISAM or low-level data and index file is not closed but the c-treeDB table object resources are released and the object re-initialized.- Throws:
CTException
- in case of error- See Also:
-
MoveSegment
Moves a segment to another position.- Parameters:
hIndex
-CTIndex
object representing whose segment is being moved.segNumber
- Current segment number.newIndex
- New segment number.- Throws:
CTException
- in case of error- See Also:
-
MoveSegment
Moves a segment to another position.- Parameters:
indexNumber
- Index number whose segment is being moved.segNumber
- Current segment number.newIndex
- New segment number.- Throws:
CTException
- in case of error- See Also:
-
MoveSegment
Moves a segment to another position.- Parameters:
indexName
- Index name whose segment is being moved.segNumber
- Current segment number.newIndex
- New segment number.- Throws:
CTException
- in case of error- See Also:
-
PartAdminByName
Performs a partition operation on the partition specified by name.- Parameters:
PartName
- Partition name.PartMode
-CTPART_MODE_E
indicating the operation to be performed.- Returns:
- If CTPART_MODE_E.STATUS is passed returns the partition status otherwhise 0 (CTDBRET.OK).
- Throws:
CTException
- in case of error- See Also:
-
PartAdminByNumber
Performs a partition operation on the partition specified by raw partition number.- Parameters:
Prawno
- Raw number of the partition.PartMode
-CTPART_MODE_E
indicating the operation to be performed.- Returns:
- If CTPART_MODE_E.STATUS is passed returns the partition status otherwise 0 (CTDBRET.OK).
- Throws:
CTException
- in case of error- See Also:
-
SetIdentityField
Sets the identity field.- Parameters:
FieldName
- Field name to be changed to identity.Seed
- Identity seed value.Increment
- Identity increment value.- Throws:
CTException
- in case of error- See Also:
-
NumberOfKeyEntries
Retrieves the number of key entries in a index file.- Parameters:
index
- Index number to be checked. The first index number is zero.- Returns:
- Number of index entries.
- Throws:
CTException
- in case of error- See Also:
-
NumberOfKeyEntries
Retrieves the number of key entries in an index file.- Parameters:
indexName
- Index name to be checked. The first index number is zero.- Returns:
- Number of index entries.
- Throws:
CTException
- in case of error- See Also:
-
GetIdentityField
Retrieves the name of the Identity field.- Returns:
- Identity field name or null. If null, use ctdb.GetError() to determine if there was an error or simply there was no identity field defined.
- See Also:
-
GetIdentityFieldSeed
Retrieves the seed value of the Identity field.- Returns:
- Identity field seed.
- Throws:
CTException
- in case of error- See Also:
-
GetIdentityFieldIncrement
Retrieves the increment value of the Identity field.- Returns:
- Identity field increment.
- Throws:
CTException
- in case of error- See Also:
-
GetLastIdentity
Retrieves the next identity value.- Returns:
- Last identity value.
- Throws:
CTException
- in case of error- See Also:
-
GetBinaryFlag
Retrieves the fieldBINARY_FLAG
. The field binary flag indicates how c-treeDB will handle CT_ARRAY, CT_F2STRING and CT_2STRING fields.- Parameters:
FieldNumber
- Field number to be checked.- Returns:
- Current
BINARY_FLAG
value. - Throws:
CTException
- in case of error- See Also:
-
GetBinaryFlag
Retrieves the fieldBINARY_FLAG
. The field binary flag indicate how c-treeDB will handle CT_ARRAY, CT_F2STRING and CT_2STRING fields.- Parameters:
FieldName
- Field name to be checked.- Returns:
- Current
BINARY_FLAG
value - Throws:
CTException
- in case of error- See Also:
-
SetBinaryFlag
Sets the fieldBINARY_FLAG
. The field binary flag indicates how c-treeDB will handle CT_ARRAY, CT_F2STRING and CT_2STRING fields.- Parameters:
FieldNumber
- Field number to be modified.Flag
- NewBINARY_FLAG
value.- Throws:
CTException
- in case of error- See Also:
-
SetBinaryFlag
Sets the fieldBINARY_FLAG
. The field binary flag indicates how c-treeDB will handle CT_ARRAY, CT_F2STRING and CT_2STRING fields.- Parameters:
FieldName
- Field name to be modified.Flag
- NewBINARY_FLAG
value.- Throws:
CTException
- in case of error- See Also:
-
Clone
Creates a new table based on the current one.- Parameters:
target
- TargetCTTable
object.targetName
- Target table name without file extension.- Throws:
CTException
- in case of error- See Also:
-
CreateResultSet
Creates aCTResultSet
object for the current table.- Parameters:
Name
- Result Set name to be created.- Returns:
- New
CTResultSet
object. - Throws:
CTException
- in case of error- See Also:
-
CreateMRTTable
public void CreateMRTTable(String Name, String ParentName, int CreateMode, String Filter) throws CTException Creates a new MRTTable based on a host table..- Parameters:
Name
- The table nameParentName
- The host table nameCreateMode
- The create mode for the tableFilter
- The filter to apply to the host table to identify the record belonging to this MRTTable- Throws:
CTException
- in case of error
-
GetResultSetByName
Retrieves theCTResultSet
for the current table by its name.- Parameters:
Name
- Result Set name to be retrieved.- Returns:
- Found
CTResultSet
object. - Throws:
CTException
- in case of error- See Also:
-
AddFullTextIndex
Add a new index to the table- Parameters:
name
- full text index name- Returns:
- a new
CTFullTextIndex
object representing the new full text index - Throws:
CTException
- in case of error- See Also:
-
DelFullTextIndex
Delete a Full Text index from a table- Parameters:
indexNumber
- the number of the index to delete- Throws:
CTException
- in case of error- See Also:
-
DelFullTextIndex
Delete a full text index from a table- Parameters:
indexName
- the name of the index to delete- Throws:
CTException
- in case of error- See Also:
-
GetFullTextIndex
Retrieve a Full Text index object- Parameters:
indexNumber
- the number of the FTI to retrieve- Returns:
- a
CTFullTextIndex
object representing the passed full text index - Throws:
CTException
- in case of error- See Also:
-
GetFullTextIndex
Retrieve the Full Text index given its name- Parameters:
name
- The name of the FTI to retrieve- Returns:
- a
CTFullTextIndex
object representing the passed full text index - Throws:
CTException
- in case of error- See Also:
-
GetFullTextIndexCount
public int GetFullTextIndexCount()Retrieve the number of full text indices of this table- Returns:
- The number of full text index in the current table
- See Also:
-
SetFullTextIndexOption
public void SetFullTextIndexOption(CTFullTextIndex pIndex, int option, String svalue, int ivalue) throws CTException Set Full Text index options- Parameters:
pIndex
- Full Text index objectoption
- option to set. UseFTI_OPTION
to pass this valuesvalue
- value to set the option to for option taking string valueivalue
- value to set the option to for option taking long value- Throws:
CTException
- in case of error- See Also:
-
SetFullTextIndexOption
public void SetFullTextIndexOption(int indexNbr, int option, String svalue, int ivalue) throws CTException Set Full Text index options- Parameters:
indexNbr
- Full Text index numberoption
- option to set. UseFTI_OPTION
to pass this valuesvalue
- value to set the option to for option taking string valueivalue
- value to set the option to for option taking long value- Throws:
CTException
- in case of error- See Also:
-
SetFullTextIndexOption
public void SetFullTextIndexOption(String indexName, int option, String svalue, int ivalue) throws CTException Set Full Text index options- Parameters:
indexName
- Full Text index nameoption
- option to set. UseFTI_OPTION
to pass this valuesvalue
- value to set the option to for option taking string valueivalue
- value to set the option to for option taking long value- Throws:
CTException
- in case of error- See Also:
-
GetPartitionIndexNbr
public int GetPartitionIndexNbr()Retrieve the number of the partition index- Returns:
- The partition index number. -1 in case is there is not partition number
-
HasLocks
public boolean HasLocks()Check if there is any lock acquired on the table in the current session.- Returns:
- true if locks are present, false otherwise.
- See Also:
-