我正在尝试编写一个基本的PL / SQL For循环并继续收到错误。我的发言是:
begin
for tab_x in
(select unique table_name from all_tables
where owner like 'MSGCENTER_DBO%'
and table_name like 'MSG_DETAIL%')
loop
DBMS_OUTPUT.PUT_LINE(tab_x);
end loop;
end;
/
错误消息是
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 6, column 7:
PL/SQL: Statement ignored
我可能遗漏了一些非常明显但却无法使其发挥作用的东西。我感谢任何帮助!
答案 0 :(得分:2)
您想要访问tab_x.table_name
。
begin
for tab_x in
(select unique table_name from all_tables
where owner like 'MSGCENTER_DBO%'
and table_name like 'MSG_DETAIL%')
loop
DBMS_OUTPUT.PUT_LINE(tab_x.table_name );
end loop;
end;
/