【发布时间】:2013-04-19 19:11:56
【问题描述】:
我的 cmd 脚本现在看起来像这样:
for /f "delims=" %%a in ('sqlplus user/pass@OMP1 @CheckRowCount.SQL') do set rowcount=%%a
if %ROWCOUNT% GTR 0 (
c:\Autobatch\Spotfire.Dxp.Automation.ClientJobSender.exe http://server/spotfireautomation/JobExecutor.asmx c:\AutoBatch\backup\Trigger_Test.xml
)EXIT
我知道
'sqlplus user/pass@omp1 @checkrowcount.sql'
之所以有效,是因为当我单独运行它时,我确实在 sqlplus 中获得了一个行数。
c:\Autobatch\Spotfire.Dxp.Automation.ClientJobSender.exe http://server/spotfireautomation/JobExecutor.asmx c:\AutoBatch\backup\Trigger_Test.xml
在 CMD 中单独运行时也同样有效。
我想要做的是,如果 sqlplus 命令返回 > 0 的行数,则运行另一个命令。否则退出...似乎无法将它们串在一起工作。
【问题讨论】:
-
有什么问题?您是否收到错误消息或意外结果?
标签: batch-file cmd sqlplus