Obtains the descriptor of the indicated version of schema name. If the parameter version is the constant CURRENT_VERSION, the descriptor of the current version of the schema is obtained.
This function opens the schema of the version passed as parameter. In case the constant current version is passed CURRENT_VERSION , the latest will be opened. If the operation is succesfull, the function OpenSchemaVersion returns the schema descriptor, places it in the list of \xc7 active schemas\xc8 and marks it as current.
Returns the number of version associated to the schema descriptor. If the descriptor belongs to the current version, it returns CURRENT_VERSION.
This function returns the number of the schema version that was active at date d, or the constant CURRENT_VERSION if no new versions have been created.
See the IDEAFIX Programmer's Reference.
Is equivalent to DoTransaction but executes an EndSyncTransaction instead an EndTransaction each cycle.
This sentence allows the user to retry the transaction between brackets until it ends successfully.
Example:/* inside the DoTransaction goes the body of the transaction that will be repeated until it ends successfully */ int num_try = 0; DoTransaction { GetRecord(...); GetRecord(...); if (...) PutRecord(...); else PutRecord(...); /* he programmer decides not to wait anymore and escapes from the cycle. */ if (!TransOk() && ++num_try > 20) { AbortTrans(); ... break; } }
Using the functions BeginTransaction and EndTransaction guarantees that all the operations in the transaction will be completed, or no one will be. If it is nee ded that the transaction stays registered in case the system goes down, the func tion EndSyncTransaction will have to be used because it guarantees the sync (sto ring to disk) of the tramsactions.
This function works in a way similar to IDEAFIX's EndTransaction. It returns TRUE if the transaction ended sucessfully and FALSE otherwise.
This functions restores the state to that the one prvious to the last transaction
Returns FALSE or TRUE depending on if the current transactio n has or has not been aborted.
void SetCursorFrom(dbcursor cursor, ...);
void SetCursorTo(dbcursor cursor, ...);
void MoveCursorFirst(dbcursor cursor);
void MoveCursorLast(dbcursor cursor);
void SetCursorFromFld(dbcursor cursor, int nfield, char *value);
void SetCursorToFld(dbcursor cursor, int nfield, char *value);
long FetchCursorPrev(dbcursor cursor);
long FetchCursor(dbcursor cursor);
void DeleteCursor(dbcursor cursor);
These functions are described in the IDEAFIX Programmer's Manual. It has to be considered that CreateCursor receives two additional parameters to the usual modes:
IO_KEY_FIELDS: when using this flag, FetchCursor or FetchCursorPrev will only bring the fields that belong to the index the cursor was created with.
IO_READ: This modifier obtain a read lock on the record. This allows for greater flexibility, because it is possible to define multiple read locks on the same record. However, a read lock cannot coexist with a write lock.
IO_PLOCK: This modifir defines locks that are maintained throughout transactions. This means that the lock won't dissapear at the end of the transaction and will dissapear only when the programmer releases it explicitly or the process ends.
IO_KEEP_LOCKS: This modifier (that only makes sense when the cursor is created to lock) indicates the cursor not to free automatically the locks that are being created. Later, it will be the responsibility of the programmer to release them. The only exception to this will be when the cursor is used within a transaction; in this case the locks will be released at transaction's end.
Returns the number of records inside the range of the cursor.
Deletes all the cursors associated to the schema sch.
Places in the current record of the table associated to the cursor the last record read with FetchCursor/FetchCursorPrev.
Receives the list of field descriptors to bring to the current record each time a FetchCursor/FetchCursorPrev is executed. The end is indicated with a zero.
Example:
Example: dbfield flds[] = { TABLE_CAMPO1, TABLE_CAMPO4, 0 }; SetCursorVFlds(cur, flds);
To create an index it is mandatory, after CreateIndex (and the corresponding AddIndField), to run BuildIndex, AddKey or CompleteIndex.
The use of this new function makes sense only when the table hasn't yet any records to include in the index.
This routine executes a checkpoint on the server corresponding to the schema passed as parameter. If the checkpoint was successfully executed, it returns TRUE, otherwise, it returns FALSE. To execute a checkpoint on the current schema, it is possible to do the following:
DBMS_IDEAFIX: the application is using IDEAFIX to access the data.
DBMS_ESSENTIA: the application is using Essentia to access the data.
IO_READ: This modifier obtain a read lock on the record. This allows for greater flexibility, because it is possible to define multiple read locks on the same record. However, a read lock cannot coexist with a write lock.
IO_PLOCK: This modifir defines locks that are maintained throughout transactions. This means that the lock won't dissapear at the end of the transaction and will dissapear only when the programmer frees it explicitly or the process ends.
Sets a cache of n records for table tbl.
Each time a GetRecord is executed over the table tbl with parameters THIS_KEY and IO_NOT_LOCK, Essentia's access library will search first in this cache the requested record, and, when not found, it will access the server. If the data is found, it will be placed as current record of the table and inside the cache. This will allow that floowing GetRecord (with THIS_KEY/IO_NOT_LOCK) find the record in the cache, thus avoiding the access to Essentia.
This function executes update operations over the fields of a table, without reading/saving all the record.
Operations:
U_ADD: add a certain value to the field.
U_SUB: substracts a certain value to the field.
U_MUL: multiplies the field by a number.
U_DIV: divides the field by a number.
U_SET: set's the field's value.
U_COPY: copies one field over the other.
Example:
This sentence sets the field TABLA_CAMPO1 with value 0.0, the field TABLA_CAMPO2 is added the value 10.0 and TABLA_CAMPO4 is copied over TABLA_CAMPO3.
When using arrays it is neccessary to indicate the range of the vector where the operation is to be performed.
This sentence multiplies by 20.0 the array TABLA_CAMPOV but only for the elements between 0 and 10.