

Data Manipulation Language Statements › FIND/OBTAIN
FIND/OBTAIN
The FIND statement locates a record occurrence in the database; the OBTAIN statement locates a record and moves the data associated with the record to the record buffers. Because the FIND and OBTAIN command statements have identical formats, they are discussed together.
Six FIND/OBTAIN Formats
The six formats of the FIND/OBTAIN statement are as follows:
- FIND/OBTAIN CALC/DUPLICATE accesses a record occurrence by using its CALC key value.
- FIND/OBTAIN CURRENT accesses a record occurrence by using established currencies.
- FIND/OBTAIN DBKEY accesses a record occurrence by using its database key.
- FIND/OBTAIN OWNER accesses the owner record of a set occurrence.
- FIND/OBTAIN WITHIN SET USING SORT KEY accesses a record occurrence in a sorted set by using its sort-key value.
- FIND/OBTAIN WITHIN SET/AREA accesses a record occurrence based on its logical location within a set or on its physical location within an area.
Each format of the FIND/OBTAIN statement is discussed separately in the following subsections.
SHARED and EXCLUSIVE Locks
You can place locks on located record occurrences by using the KEEP clause of a FIND/OBTAIN statement. The KEEP clause sets a shared or exclusive lock:
- KEEP places a shared lock on the located record occurrence. Other concurrently executing run units can access but not update the locked record.
- KEEP EXCLUSIVE places an exclusive lock on the located record occurrence. Other concurrently executing run units can neither access nor update the locked record.
More information:
KEEP CURRENT
Copyright © 2014 CA.
All rights reserved.
 
|
|