文件名称:和上面那种-微信小程序wx.request的简单封装
文件大小:273KB
文件格式:PDF
更新时间:2024-06-23 14:11:45
DB2 游标
FOR -- (1)和上面那种 read-only cursor语法 类似,只是 多了 FOR UPDATE SELECT emendate FROM emp_act FOR UPDATE; OPEN c_emp; FETCH FROM c_emp INTO v_date; -- 注意此处,不要落了 SET p_deleted = 0; WHILE ( SQLSTATE = '00000' ) DO IF ( v_date < p_date ) THEN DELETE FROM emp_act WHERE CURRENT OF c_emp; -- (2) SET p_deleted = p_deleted + 1; END IF; FETCH FROM c_emp INTO v_date; END WHILE; CLOSE c_emp; END ca 直接用 DELETE语句删除而不用游标被称作 searched delete。像上例这种情况, 采用 searched delete会比使用 positioned delete效率更高。但用 positioned delete可以处理更复杂的逻辑 Positioned Update 一个用于更新的游标(A cursor is updatable)应该 The cursor is deletable