Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    4

    Unanswered: Update record in a cursor

    Please tell me how to code the Update of the current cursor record as one would do using VD/ADO :

    VB: Table("Fieldname") = Value

    ----------------------------------------------------------
    Declare @NextNo integer
    Select @NextNo = (Select NextNo from NextNumbers where NNId = 'AddressBook') + 1

    --Create a Cursor through wich to lo loop and Update the ABAN8 with the corrrect NextNo
    DECLARE Clone_Cursor CURSOR FOR Select ABAN8 from JDE_Train.trndta.F0101_Clone
    Open Clone_Cursor
    Fetch Next from Clone_Cursor
    WHILE @@FETCH_STATUS = 0
    BEGIN
    Select @NextNo = @NextNo + 1
    Clone_Cursor("ABAN8") = @NextNo
    Update Clone_Cursor
    FETCH NEXT FROM Clone_Cursor
    END

    CLOSE Clone_Cursor
    DEALLOCATE Clone_Cursor
    GO

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    It sounds like you need a CURRENT OF condition in your UPDATE statement.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •