The am_beginscan purpose function
The database server calls am_beginscan to start a scan on a virtual table. This function initializes the scan.
Syntax
mi_integer am_beginscan(MI_AM_SCAN_DESC *scanDesc)
- scanDesc
- Points to the scan descriptor.
Usage
The functions that the access method
supplies for am_beginscan, am_getnext,
and am_endscan compose the main scan-management
routines. In its turn, the am_beginscan purpose
function can perform the following operations:
- Obtain the qualification descriptor from the scan descriptor
- Parse the criteria in the qualification descriptor
- Determine the need for data type conversions to process qualification expressions
- Based on the information in the qualification descriptor, initiate a search for data that fulfills the qualification
- Allocate PER_COMMAND memory to build user data and then store the user data in the scan descriptor for the am_getnext function
You can also choose to defer any processing of qualifications until the am_getnext function.
Return values
- MI_OK
- Indicates success.
- MI_ERROR
- Indicates failure.