declare
cursor emp_cursor is select * from tg_test_user;
begin
for tg_test_user in emp_cursor loop
dbms_output.put_line('用户名:'||tg_test_user.tg_test_username||' ,密码:'||tg_test_user.tg_test_password);
exit when emp_cursor%rowcount=&n;
end loop;
end;
                
        cursor emp_cursor is select * from tg_test_user;
begin
for tg_test_user in emp_cursor loop
dbms_output.put_line('用户名:'||tg_test_user.tg_test_username||' ,密码:'||tg_test_user.tg_test_password);
exit when emp_cursor%rowcount=&n;
end loop;
end;
 
                   
                   
                   
                   
                            
 
                             本文介绍了一个使用PL/SQL编写的简单示例程序,该程序通过定义游标从数据库表中检索数据,并利用循环遍历游标返回的记录集,最终输出每条记录的用户名和密码。
本文介绍了一个使用PL/SQL编写的简单示例程序,该程序通过定义游标从数据库表中检索数据,并利用循环遍历游标返回的记录集,最终输出每条记录的用户名和密码。
           
       
           
                 
                 
                 
                 
                 
                
               
                 
                 
                 
                 
                
               
                 
                 扫一扫
扫一扫
                     
                     
              
             
                   878
					878
					
 被折叠的  条评论
		 为什么被折叠?
被折叠的  条评论
		 为什么被折叠?
		 
		  到【灌水乐园】发言
到【灌水乐园】发言                                
		 
		 
    
   
    
   
             
					 
					 
					


 
            