<div id="codeSnippetWrapper"> <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New',courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New',monospace; direction: ltr; border-top-style: none; color: black; font-size: 10pt; border-left-style: none; overflow: visible; padding-top: 0px">--演示隐式游标,系统自动声明,自动打开,自动使用并且自动关闭
emp sal = 1000;
|| %);
;
;
mycur * emp deptno = 20;
mycur; --打开游标
mycur emprow; --把游标所指的纪录放到变量中
(mycur%notfound); --当游标没有指向行时退出循环
|| emprow.ename || || emprow.sal);
loop;
mycur; --关闭游标
;
mycur ename,sal emp deptno = 30;
mycur;
mycur empname,empsal;
mycur%notfound;
|| empname || || empsal);
loop;
c
* dept;
c;
c vDept_row_record;
c;
c
* dept;
c;
c vDept_row_record;
(c%notfound);
loop;
c
c vDept_row_record;
(c%) loop
c vDept_row_record;
vDept_row_record c loop
loop;
c(sSal emp.sal%type,sEmpno emp.empno%type)
* emp sal >= sSal empno > sEmpno;
record_data c(2500,6666) loop
c(sSal emp2.sal%type)
* emp2 sal >= sSal ;
record_data c(2500) loop
(record_data.sal < 3000)
emp2 sal = sal + 3 c;
emp2 sal = sal - 3 c;
;
;
;
(which = )
mycur * dept;
mycur deptrow;
(mycur%notfound);
|| deptrow.dname);
loop;
)
mycur * emp;
mycur emprow;
(mycur%notfound);
|| emprow.ename);
loop;
;
mycur;
number是错的, emp.ename%type也是错的
emp%rowtype;
mycur * emp;
mycur emprow;
mycur%notfound;
|| emprow.ename);
mycur;
;
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|