如何在SQL*Plus中执行动态SQL语句
我想使用动态SQL语句修改值。该示例选择是可生殖的。我知道我不需要动态的SQL语句。
variable a number =1;
print a
1
exec execute immediate 'select 2 into :a from dual'
PL/SQL过程成功完成。
print a
1
1返回而不是2,这意味着我的陈述未执行。
那么,如何执行呢?
I would like to modify a value by using a dynamic sql statement. The example is choosen to be reproductible. I know that I don't need a dynamic sql statement for that.
variable a number =1;
print a
1
exec execute immediate 'select 2 into :a from dual'
PL/SQL procedure successfully completed.
print a
1
1 is returned instead of 2, which means that my statement wasn't executed.
So, how can it be executed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
到
中应超出立即执行
:INTO
should be out ofexecute immediate
: