测试带参数的静态游标

declare
  cursor c(v_ename varchar2) is select * from emp where ename = v_ename;
  e emp%rowtype;
begin
  open c('KING'); -- 填写的是谁,最后输出的就是谁的信息
  loop
    fetch c into e;
  exit when c%notfound;
  dbms_output.put_line(e.empno||'  '||e.ename||'  '||e.job||'  '||e.mgr||'  '||e.hiredate||'  '||'  '||e.sal||'  '||'  '||e.comm||'  '||e.deptno);
  end loop;
  close c;
end;

 

版权声明:
作者:k, k
链接:https://kuyour.top/?p=79
来源:KuKey
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
测试带参数的静态游标
declare cursor c(v_ename varchar2) is select * from emp where ename = v_ename; e emp%rowtype; begin open c('KING'); -- 填写的是谁,最后输出……
<<上一篇
下一篇>>