Home >Database >Mysql Tutorial >Oracle中用游标更新字段值的面试题

Oracle中用游标更新字段值的面试题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:16:111124browse

如下表 SQLgt; set pagesize 60; SQLgt; run; 1* select * from employee NAME SALARY ---------- -

如下表

在这个表如果SALARY列小于2500 就加20%。这个很简单,但是要用把游标用进去就要如下思考了:

先建个游标,,遍历这个表在这个条件的数据。

SQL> create or replace procedure emp_test is v_name employee.name%type; v_sal employee.salary%type; cursor cursor_sal is select name,salary from employee where salarylinux
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:MongoDB(NoSQL) 入门Next article:OCCI开发环境搭建