Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
来自BAT文件的SQL_Sql_Batch File - Fatal编程技术网

来自BAT文件的SQL

来自BAT文件的SQL,sql,batch-file,Sql,Batch File,我有一个奇怪的问题。我正在从bat文件执行此操作 cd C:\LabWorks dbisqlc -c "DSN=Labworksdb;UID=users;PWD=labworks" select PONUMBER, orderstatus, writeback, shipdate from orderinfo, shippinginfo where orderinfo.custid = '52467' and orderinfo.orderid = shippinginfo.orderid an

我有一个奇怪的问题。我正在从bat文件执行此操作

cd C:\LabWorks
dbisqlc -c "DSN=Labworksdb;UID=users;PWD=labworks" select PONUMBER, orderstatus, writeback, shipdate from orderinfo, shippinginfo where orderinfo.custid = '52467' and orderinfo.orderid = shippinginfo.orderid and shippinginfo.shipid > '505800'; Output to \\dp-2\ftp\Nanipics\NP_Status.csv
查询在我的DB工具中运行良好,但当我运行bat文件时,它会更改我的查询,然后出现明显的错误。见附图


有什么想法吗?

您没有引用传递给
dbisqlc
的字符串。将查询用双引号括起来

dbisqlc -c "DSN=Labworksdb;UID=users;PWD=labworks" "select PONUMBER, orderstatus, writeback, shipdate from orderinfo, shippinginfo where orderinfo.custid = '52467' and orderinfo.orderid = shippinginfo.orderid and shippinginfo.shipid > '505800'; Output to \\dp-2\ftp\Nanipics\NP_Status.csv"

否则,命令解释器会认为您正在将输出重定向到文件“505800”,然后执行名为
output

谢谢!现在Server2008因为DEP而终止了它。奇怪的是,查询工作正常,就在我添加的时候,shippinginfo.shipid>'505800'