1 | Hash name | Input | Char(10) |
2 | Function | Input | Char(1) |
3 | Number of keys | Input | Binary(4) |
4 | Key values | Input | Char(*) |
5 | Data | I/O | Char(*) |
6 | Length of Data | Input | Binary(4) |
7 | Return code | Output | Binary(4) |
The Run Database Hash (qdbrunha) API allows the user to FETCH, UPDATE, DELETE and INSERT data into existing database files using an alternative access method. The hash approach can be used on relatively static files in situations where it is desirable to reduce the amount of memory that is consumed by indexes. Its affectiveness is reduced in memory-rich environments or environments with dynamic data.
The hash name used to access the data. See the description of the Create Database Hash (qdbcrtha) API for information on defining and naming the hash.
The function to be performed. The possible values are character digits as follows:
1 | Fetch a row for read purposes only |
2 | Fetch a row with intent to update |
3 | Update the currently locked row |
4 | Delete the currently locked row |
5 | Insert a row into the database |
The number of keys used by the hash.
A structure containing up to five rows of the name of key fields and the value of key fields in the order that they appear in the logical file used to create the hash. For more details, see Field Descriptions.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
CHAR(10) | Name of key | ||
Binary(4) | Value of key |
A pointer to the actual row of data from the database to be manipulated according to the function parameter. The row will be inserted, deleted, updated, or fetched from the database.
The length of the buffer in the application that will receive or contain the data.
A numeric indication as to what took place during the hash function request. The possible values are:
0 | No errors. |
1 | Hash user space does not exist. |
2 | Hash does not exist. |
100 | Record not found. |
812 | Lock-wait time-out. |
-99 | Another error was encountered and ignored. See job log for details. |
Name of key. The name of the key field in the order that they appear in the logical file referenced in the associated Create Database Hash (QDBCRTHA) API. The names are for documentation purposes only.
Value of key. The key value used by the API to access the appropriate record in the file.
Only the error conditions listed in the return code parameter are monitored. No error messages other than the value of the return code parameter are returned.
Top | Database and File APIs | APIs by category |