Define the cursor lock types.- Cursors allow row-by-row processing of the resultsets.
- It is a database object which is used to retrieve data from a resultset one row at a time.
Following are the three lock types of cursor:
1. READ ONLY 2. SCROLL LOCK 3. OPTIMISTIC
- Each time you fetch a row from the cursor, it results in a network roundtrip.
- Cursors are also costly because they require more resources and temporary storage.
1. READ ONLY: - It prevents any updates to the table.
2. SCROLL LOCK: - It allows you to make changes to the table.
3. OPTIMISTIC: - It checks if any changes in the table record since the rows are fetched before updating. - If there is no change, then the cursor can update.
|