.bat文件可以执行sql查询并返回值吗? [英] Can .bat file execute an sql query and return a value?

查看:588
本文介绍了.bat文件可以执行sql查询并返回值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从.bat文件调用查询? (假设我的查询是:从系统中选择版本).

How can I call a query from a .bat file? (say my query is: select version from system).

我的.bat文件可以保存该查询返回的输出吗?我想在我的NSIS脚本中使用此输出.

Can my .bat file save the output that this query returns? I wanna use this output in my NSIS script.

推荐答案

对于Oracle:

您可以将输出通过管道传输到文件中并使用它,也可以将其包装在for命令中以解析批处理文件中的输出.

You can either pipe the output to a file and use that, or wrap this in a for command to parse the output within your batch file.

这篇关于.bat文件可以执行sql查询并返回值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆