1 -- 循环输出用户表信息(游标提取) 2 declare 3 -- 提取游标对象,方便单独维护SQL 4 cursor cursor_all_users is 5 select user_id, username, created from all_users; 6 -- 游标子项(更多的时候,表是动态表,所以这句声明也可以省略) 7 -- cursor_user all_users%rowtype; 8 begin 9 for cursor_user in cursor_all_users loop 10 dbms_output.put_line(cursor_user.username); 11 end loop; 12 end;