oracle创建游标和输出

declare
  cursor c_test_tbl2 is
    select t2.id, t2.salary
      from test_tbl2 t2, test_tbl1 t1
     where t2.id = t1.id
       and t2.salary <> t1.salary;
  c_row c_test_tbl2%rowtype;
begin
  for c_row in c_test_tbl2 loop
    dbms_output.put_line(c_row.id || '-' || c_row.salary);
  end loop;
end;

PLsql中,输出结果如下:

 

 

posted @ 2013-09-28 14:48  jmStatham  阅读(1532)  评论(0编辑  收藏  举报