Without cursor
SQL statement |
Function |
DELETE |
Delete rows |
INSERT |
Insert rows in table |
MERGE |
Insert rows in table or change column values |
SELECT...INTO |
Read individual rows (static SELECT statement) |
SELECT (without INTO) |
Read individual rows (dynamic SELECT statement) |
UPDATE |
Update column values |
Table 36: SQL statements for querying and updating data without a cursor
With cursor
The following SQL statements can be used with a static or dynamic cursor.
If an executable statement contains a dynamic cursor, the corresponding cursor description must be prepared before the statement is executed.
In some statements there are certain deviations or restrictions if a dynamic cursor is used. This fact is mentioned in the table.
SQL statement |
Function |
CLOSE |
Close a cursor |
DECLARE...CURSOR |
Declare a cursor (not executable) |
DELETE...CURRENT |
Delete current row |
FETCH |
Position cursor and read column value |
OPEN |
Open a cursor |
RESTORE |
Restore a cursor |
STORE |
Save cursor position |
UPDATE...CURRENT |
Update the current row |
Table 37: SQL statements for querying and updating data with cursor