skip to content »

tenpoint.ru

Creating cursors in sql and updating each line in cursor

creating cursors in sql and updating each line in cursor-42

DYNAMIC Defines a cursor that reflects all data changes made to the rows in its result set as you scroll around the cursor.The data values, order, and membership of the rows can change on each fetch.

creating cursors in sql and updating each line in cursor-39

The cursor cannot be referenced in a WHERE CURRENT OF clause in an UPDATE or DELETE statement.This option overrides the default capability of a cursor to be updated.UPDATE [OF must conform to the rules for identifiers.The cursor is implicitly deallocated when the batch, stored procedure, or trigger terminates, unless the cursor was passed back in an OUTPUT parameter.If it is passed back in an OUTPUT parameter, the cursor is deallocated when the last variable referencing it is deallocated or goes out of scope.FAST_FORWARD cannot be specified if SCROLL or FOR_UPDATE is also specified.

READ_ONLY Prevents updates made through this cursor.

When neither FORWARD_ONLY nor SCROLL is specified, FORWARD_ONLY is the default, unless the keywords STATIC, KEYSET, or DYNAMIC are specified.

STATIC, KEYSET, and DYNAMIC cursors default to SCROLL.

LOCAL Specifies that the scope of the cursor is local to the batch, stored procedure, or trigger in which the cursor was created. The cursor can be referenced by local cursor variables in the batch, stored procedure, or trigger, or a stored procedure OUTPUT parameter.

An OUTPUT parameter is used to pass the local cursor back to the calling batch, stored procedure, or trigger, which can assign the parameter to a cursor variable to reference the cursor after the stored procedure terminates.

SCROLL cannot be specified if FAST_FORWARD is also specified.