ITeye博客

PL/SQL的游标使用小例

sprite · 2007-02-26 16:02 · 数据库 · Markdown

sql 代码

  1. set serveroutput on
  2. declare
  3. tempsal scott.emp.sal%type;
  4. cursor mycursor is
  5. select * from scott.emp
  6. where sal>tempsal;
  7. cursorrecord mycursor%rowtype;
  8. begin
  9. tempsal:=800;
  10. open mycursor;
  11. fetch mycursor into cursorrecord;
  12. if mycursor%found then
  13. dbms_output.put_line(to_char(mycursor%rowcount));
  14. else
  15. dbms_output.put_line('没有找到数据');
  16. end if ;
  17. end;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。