WHERE CURRENT OF
来源:互联网 发布:python signal 编辑:程序博客网 时间:2024/05/16 06:09
如果你想删除或者更新被Select For Update引用的记录,你可以使用Where Current Of语句。
Where Current Of语句允许你更新或者是删除最后由cursor取的记录。
下面一个使用Where Current Of更新记录的例子:
Deleting using the WHERE CURRENT OF Statement
Here is an example where we are deleting records using the Where Current Of Statement:
译:下面一个使用Where Current Of删除记录的例子:
UPDATE table_name SET set_clause WHERE CURRENT OF cursor_name;ORDELETE FROM table_nameWHERE CURRENT OF cursor_name;
Where Current Of语句允许你更新或者是删除最后由cursor取的记录。
下面一个使用Where Current Of更新记录的例子:
CREATE OR REPLACE Function FindCourse ( name_in IN varchar2 ) RETURN numberIS cnumber number; CURSOR c1 IS SELECT course_number, instructor from courses_tbl where course_name = name_in FOR UPDATE of instructor;BEGINopen c1;fetch c1 into cnumber;if c1%notfound then cnumber := 9999;else UPDATE courses_tbl SET instructor = 'SMITH' WHERE CURRENT OF c1; COMMIT;end if;close c1;RETURN cnumber;END;
Deleting using the WHERE CURRENT OF Statement
Here is an example where we are deleting records using the Where Current Of Statement:
译:下面一个使用Where Current Of删除记录的例子:
CREATE OR REPLACE Function FindCourse ( name_in IN varchar2 ) RETURN numberIS cnumber number; CURSOR c1 IS SELECT course_number, instructor from courses_tbl where course_name = name_in FOR UPDATE of instructor;BEGINopen c1;fetch c1 into cnumber;if c1%notfound then cnumber := 9999;else DELETE FROM courses_tbl WHERE CURRENT OF c1; COMMIT;end if;close c1;RETURN cnumber;END;
- WHERE CURRENT OF
- where current of 子句
- Oracle/PLSQL: WHERE CURRENT OF Statement
- Oracle/PLSQL: WHERE CURRENT OF Statement
- Oracle/PLSQL: WHERE CURRENT OF Statement
- Oracle/PLSQL: WHERE CURRENT OF Statement
- Oracle 游标的where current of子句
- for update 与where current of的问题
- Oracle游标之select for update和where current of 语句
- PLSQL条件语句完成员工加薪功能(记录类型+游标case when+if+for update+where current of)
- Drawback of current RCA
- doodle of current mood
- current of 使用
- 在游标中使用FOR UPDATE 和 WHERE CURRENT
- Get the self URL of current page
- Problems of Current NLP Approaches读后感
- Current Screenshot of my Operating System
- Secret of oracle logic IO: Current Mode
- java父类与子类的多态性
- linux中端口扫描
- jQuery设置指定表格每行第一列的宽度
- 从零开始成为优秀的项目经理
- Android TextView的双向滚动
- WHERE CURRENT OF
- Jquery 模板数据绑定插件 使用方法
- 设计模式C++描述----19.命令(Command)模式
- surfaceview中重载onKeyDown函数
- oracle 11g的OEM(企业管理器),https://主机ip:1158/em/console网页无法显示
- 一些有帮助的BLOG
- PreferenceActivity详解
- 备份恢复10——逻辑备份与恢复(emp/imp)
- 交警处理高速事故时遭遇车祸殉职