如何在子图变量中给出查询的结果
问题
续集来自这个 加上代码正在工作
define a=22;
host powershell.exe echo &a;
22
但是,如果来自查询的值来自查询,则不再起作用。
define a=2;
select 22 into a;
host powershell.exe echo &a;
2而不是22
我用缓冲区尝试了,但无济于事
variable buffer varchar2;
select 22 into :buffer from dual;
define a=b;
host powershell.exe echo &a;
:b
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用语法。如果您仍然需要一个绑定变量,例如在上一个问题中,那么现在定义并填充了该变量,例如:
然后以新值定义列,您可以稍后将其称为替换变量:
您可以
设置termout Off
,如果您作为脚本运行并且不想看到输出,则在该额外查询周围返回。您可以查询任何内容,它不必是一个绑定变量:
或
You can use the
column .. new_value ...
syntax. If you still want a bind variable too, as in your previous question, then define and populate that variable however you are now, e.g.:Then define the column with a new value you can refer to later as a substitution variable:
You can
set termout off
and back on around that extra query if you're running this as a script and don't want to see the output.And you can query anything, it doesn't have to be a bind variable:
or