FOR UPDATE cursors

  • Server: Msg 16957, Level 16, State 4, Line 4

    FOR UPDATE cannot be specified on a READ ONLY cursor.

    I keep getting this error and yet this cursor format is taken dirctly out of a book

    Here is the code sniplet:

    BEGIN TRAN

    DECLARE c1 cursor KEYSET for

    select id, seq from salhistory

    WHERE id = 4015

    order by sal_date

    for update of seq

    declare @id int, @seq int , @i int

    Using standard edition version 8; permissions correct

    I am new to SQLSERV but know oracle

    Thanx

  • As long as you have an order by clause you cursor will be read only!

    I've xperienced that problem as well.

    The only way is to implement a clustered index to get an ordered set.

    Bye

    Gabor



    Bye
    Gabor

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply