我有个奇怪的问题。我正在从一个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查询在我的数据库工具中运行得很好,但是当我运行bat文件时,它改变了我的查询,然后很明显是错误的。请参阅附件中的图像。

有什么想法吗?
发布于 2013-10-24 07:52:31
您没有引用传递给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的新命令。
https://stackoverflow.com/questions/19554416
复制相似问题