欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

oracle 循环例子

程序员文章站 2022-07-14 19:14:47
...
declare  
temp_emp test_tw%rowtype;   
cursor cur2 is select * from test_tw;   
begin  
if cur2%isopen = false then  
open cur2;   
end if;   
for i in 0..5 loop   
fetch cur2 into temp_emp;   
exit when cur2%notfound;   
dbms_output.put_line('编号:'||temp_emp.id||','||'名字:'||temp_emp.xm);
end loop;   
close cur2;   
end;  

 

上一篇: number说明

下一篇: 转载文章