gpt4 book ai didi

oracle - DBMS_OUTPUT.PUT_LINE 返回错误

转载 作者:行者123 更新时间:2023-12-04 13:23:49 27 4
gpt4 key购买 nike

我正在尝试编写一个基本的 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

我可能遗漏了一些非常明显的东西,但无法让它发挥作用。感谢您的帮助!

最佳答案

您想改为访问 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;
/

关于oracle - DBMS_OUTPUT.PUT_LINE 返回错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43876033/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com