“WHERE CURRENT OF”子句将在执行 UPDATE 语句后对该行放置独占锁。“WHERE CURRENT OF”子句将指向游标最近提取的行。我们可以使用“WHERE CURRENT OF”如下方式更新游标中的行。游标定义。EXEC SQL DECLARE ORDER_CUR CURSOR FOR SELECT ORDER_ID, TRANSACTION_ID FROM ORDERS WHERE ORDER_DATE = ‘2020-07-28’ END-EXEC打开游标EXEC SQL OPEN ORDER_CUR END-EXEC提取游标并更新行SET WF-END-CURSOR-N TO TRUE PERFORM UNTIL WF-END-CURSOR-Y EXEC SQL FETCH ORDER_CUR INTO :ORDER-ID, :TRANSACTION-ID END-EXEC IF TRANSACTION-ID NOT = SPACES EXEC SQL ... 阅读更多