Chinaunix

标题: bcp在命令行中正确执行,但是在bat文件中报错! [打印本页]

作者: licheer    时间: 2007-08-27 13:52
标题: bcp在命令行中正确执行,但是在bat文件中报错!
数据库版本:12.5.0.3
bcp语句:bcp umvc..TEST in D:\test\test\bcp1.bcp -e c:\bcp_error_1.txt -b 1000 -c -t "[email=$$@@$$]$$@@$$[/email]" -r "@#$%" -U umvc -P p9o8i7 -S SYBNM

同一条语句,在开始->运行->cmd中可以正确执行
但是将此语句拷贝到update.bat中执行时,报如下错误:
Starting copy...
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message:  - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
bcp copy in failed
作者: licheer    时间: 2007-08-27 14:00
修正一下
-t的分隔符是“$$@@$$”
不知道为什么发帖子的时候会被系统改掉
作者: hobbylu    时间: 2007-08-27 16:08
我估计就是分隔符所造成的
作者: licheer    时间: 2007-08-28 10:26
可是它在命令行中是可以正确执行的啊
作者: action929    时间: 2007-08-29 13:43
因为 % 在 bat 里面是特殊字符
你试试 这个语句
bcp umvc..TEST in D:\test\test\bcp1.bcp -e c:\bcp_error_1.txt -b 1000 -c -t "[email=$$@@$$]$$@@$$[/email]" -r "@#$%%" -U umvc -P p9o8i7 -S SYBNM
作者: licheer    时间: 2007-08-29 16:55
果真可以了,谢谢楼上
作者: fgh678    时间: 2007-09-02 20:51
偶也来看看.............




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2