17,086
社区成员
发帖
与我相关
我的任务
分享
Connected as SYS
SQL> create or replace procedure pro_test
2 as
3 begin
4 for i in (
5 select table_name from dba_tables
6 where owner='SCOTT') loop
7 dbms_output.put_line('tabels in scott schema:'||i.table_name);
8 end loop;
9 end pro_test;--注意end
10 /
Procedure created
SQL> set serveroutput on;
SQL> set pagesize 100;
SQL> exec pro_test;--调用无参过程只需写过程名
tabels in scott schema:DEPT
tabels in scott schema:EMP
tabels in scott schema:BONUS
tabels in scott schema:SALGRADE
tabels in scott schema:BIN$YCT5xmhFSU+EnAnp/mSHZw==$0
tabels in scott schema:BIN$MuwRbIWjRKiVUurtyIT03w==$0
tabels in scott schema:GOODS_TB1
tabels in scott schema:GOODS_TB2
tabels in scott schema:TEST
tabels in scott schema:BIN$vPkh4GFBSw21ItWKZT4KkA==$0
tabels in scott schema:BIN$BYrKqm3ZSxykDmtNfKVNfA==$0
tabels in scott schema:PROJECT_MANAGE
tabels in scott schema:BIN$Mw8EGfnRS72UzIG/j6X+Ew==$0
tabels in scott schema:SYS_TEMP_FBT
tabels in scott schema:BIN$hUpvDWyHTPKmNcrDdDy4IQ==$0
tabels in scott schema:BIN$DFFcU4qjShmXeco/LcjswQ==$0
tabels in scott schema:BIN$uoKglXK2RnKCr1qQXRoIIg==$0
tabels in scott schema:BIN$/aoGE/7uSauFL3HTtl6wUg==$0
tabels in scott schema:BIN$LRRbWxbsSMWAAbuPUHLjCQ==$0
tabels in scott schema:TEMP_TABLE_SESSION
PL/SQL procedure successfully completed