-2

Can someone tell me how to update a data using the CURSOR in sqlrpgle.Is there a way updating data just by using CURSOR rather than using the Update statement in SQLRPGLE?

Kunal Roy
  • 729
  • 3
  • 11

1 Answers1

4

What update statement do you refer to ? UPDATE rpg order or UPDATE SQL ?

With UPDATE SQL :

  Exec SQL declare c1 cursor for
     SELECT *
        FROM xxxx ..
     for update ;   

fetch the records as usual , and before each fetch :

 exec sql
      update xxxxx  set FIELD = :FIELDRPG
      where current of c1;         
Dam
  • 986
  • 1
  • 14
  • 20