ITPub博客

首页 > Linux操作系统 > Linux操作系统 > pl/sql查询表前14行

pl/sql查询表前14行

原创 Linux操作系统 作者:leegstar 时间:2012-09-02 20:51:39 0 删除 编辑
1 declare
      2 type t1 is record(name emp.ename%type,
      3 sll emp.sal%type);
      4 t2 t1;
      5 cursor c_cursor is select ename,sal from emp where rownum <=14;
      6 /*v_ename emp.ename%type;
      7 v_sal emp.sal%type;*/
      8 begin
      9 open c_cursor;
     10 fetch c_cursor into t2;
     11 while c_cursor%found loop
     12 dbms_output.put_line(t2.name||':'||t2.sll);
     13 fetch c_cursor into t2;
     14 end loop;
     15 close c_cursor;
     16 end;
     17 /

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26585184/viewspace-742500/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-12-28

  • 博文量
    31
  • 访问量
    142660