如何在oracle数据库中逐行输出表单

magicnbh 2004-07-01 03:51:24
各位大侠,如何用在oracle中用dbms_output.put_line函数逐行输出某一个指定表的所有满足要求的项?
...全文
88 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
magicnbh 2004-07-01
  • 打赏
  • 举报
回复
使用游标是吗?
谢谢了
dinya2003 2004-07-01
  • 打赏
  • 举报
回复
用游标.
sql> set serveroutput on
sql>
delcare
cursor c is select name from user;
name user.user_name%type;
begin
open c;
loop
fetch c into name;
exit when c%notfound;
dbms_output.put_line(name);
end loop;
close c;
end;

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧