These two types of cursors are the type of updatable cursor. Positioning based cursors - Placing the cursor dynamically or sequentially at the resulting table rows separates the cursor into two types. Scrollable Cursor The scrollable cursor fetches row s many times from the result table.
Modified data reflection-based cursors - After opening the specific cursor, the modified data reflection into the cursor result table separates the cursor into two types. Those are - Cursor Decription Sensitive Cursor The cursor is sensitive to insert, update, or delete operations performed on the database table after generating the result table.
Insensitive Cursor The cursor is not sensitive to insert, update, or delete operations performed on the database table after generating the result table. If the HOLD option is not specified, this is the default. Mixed feature cursors - The cursors having more than one feature from the above comes under this category. Read Only Cursor. The read-only cursor is a cursor that is used to perform only read operations on the table or result table.
Updatable Cursor. This clause must be specified if you intend to update any or all of the rows in the identified table. In this clause you name each column you intend to update. If you do not specify the names of columns you will later update, you will receive an error code in the SQLCODE field when you try to update them. A column of the identified table can be updated even though it is not part of the results table.
This clause is used to indicate that there is no intention to update the table. It is also read-only if the FROM clause identifies a read-only view or identifies more than one table or view. This is a particular problem when a file of updates has a particular order to its records and you would like to code an ORDER BY clause so a merge can be performed.
The cursor will remain open and positioned on the current row in the cursor at the time of commit. Readies the cursor for row retrieval. OPEN is an executable statement. In that case, the process needs a unique mechanism to retrieve all rows one by one. The cursor is used to process the rows one by one from the group of rows.
The process is almost the same as pointing the finger at a particular line on the printed page. The result set is also referred to as the result table while using the cursor. Click for Topics listing. Tutorials DB2 Cursor.
Summary -. In this topic, we described about the below sections - Cursor Why Cursor?
0コメント