码迷,mamicode.com
首页 > 数据库 > 详细

Oracle PLSQL Demo - 14.定义定参数的显示游标

时间:2015-06-29 23:46:37      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

declare
    v_empno scott.emp.empno%type;
    v_sal   scott.emp.sal%type;
    cursor cur_emp(v_empno number default 7369) is
        select t.empno, t.sal from scott.emp t where t.empno = v_empno;

begin

    open cur_emp(7566);

    loop
        fetch cur_emp
            into v_empno, v_sal;
    
        exit when cur_emp%notfound;
    
        dbms_output.put_line(v_empno ||     || v_sal);
    
    end loop;

    close cur_emp;

end;

 

Oracle PLSQL Demo - 14.定义定参数的显示游标

标签:

原文地址:http://www.cnblogs.com/nick-huang/p/4609094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!