Call_Driver Function Constants
There are several symbolic constants defined for the embedded (DataFlex) database driver. They are described in the following table. They can be used in the Call_Driver command to call the functions they represent.
| Name | Meaning |
|---|---|
| FLEX_SET_MAX_SORT_BUFFER | Sets the maximum amount of memory to be used in sorting. The default is 8 Megabytes, or all available, if it is less. |
| FLEX_GET_MAX_SORT_BUFFER | Reports the maximum amount of memory to be used for sorting. |
| FLEX_SET_INDEX_OPT | Sets whether index data may be returned to the program on record finds. |
| FLEX_GET_INDEX_OPT | Returns whether index data may be returned to the program on record finds. |
| FLEX_REPAIR_FILE | Repairs a table that is damaged. |
| FLEX_GET_REPAIRS_NEEDED | Does an inspection of the file header, reporting errors found. |
| FLEX_GET_STRICT_TRANSACTIONS | Returns whether absence of TTS generates error when SERVER_ATOMIC tables are opened. |
| FLEX_SET_STRICT_TRANSACTIONS | Sets whether absence of TTS generates error when SERVER_ATOMIC tables are opened. |
Notes About the Above Functions
- When repairing a table, there are two phases:
- The header is repaired, if necessary.
-
The table is sorted, which repairs damaged indexes and a corrupt .VLD file. If you wish to skip the sort, there is a parameter of the
call_drivercommand for doing so. -
These constants are returned by
FLEX_GET_REPAIRS_NEEDEDto report what repairs are needed: FLEX_HEADER_OKFLEX_BLOCK0_BADFLEX_HEADER_BADFLEX_HEADER_INTEGRITY_OFFFLEX_HEADER_UNREADABLE
If FLEX_GET_REPAIRS_NEEDED returns FLEX_HEADER_UNREADABLE, the table probably cannot be repaired; if it returns FLEX_HEADER_INTEGRITY_OFF, it definitely cannot be.
-
To keep a table repairable, you must keep its header-integrity checking turned on (in Table Editor – Properties Panel). This maintains a .HDR file for the table that is examined by the
FLEX_GET_REPAIRS_NEEDEDfunction and used by theFLEX_REPAIR_FILEfunction. -
If you attempt to set
FLEX_SET_MAX_SORT_BUFFERto a value less than 32K, you will receive an error. Note that this function uses Kilobytes (1K = 1024 bytes). -
These constants are returned by
FLEX_GET_INDEX_OPTto report under what conditions programs may use data as contained in indexes instead of filling the record buffer to access record data after a find: FLEX_INDEX_OPT_ONFLEX_INDEX_OPT_OFFFLEX_INDEX_OPT_PERMISSIVE
ON is the default setting, allowing the use of index data for all segments that are not set case-insensitive. OFF prohibits all use of index data; the record buffer is always loaded. PERMISSIVE allows the use of all index data, including that in case-insensitive index segments.
FLEX_SET_STRICT_TRANSACTIONSis useful for utility and other programs that do not enter or edit transactions and may be executed without the NetWare shell. If a table whoseDF_FILE_TRANSACTIONattribute is set toSERVER_ATOMICis opened by an application not running under the NetWare shell, an error will be returned. Setting this function toDFFALSEwill suppress the error and permit the open, without modifying the table's attribute.