格式文件错误“'bcp' 不是内部或外部命令,也不是可运行的程序或批处理文件。”

Format file Error "'bcp' is not recognized as an internal or external command, operable program or batch file."

我想为 SQL 服务器创建格式文件 (.fmt),以便从 Azure Blob 存储进行批量插入。我正在使用以下代码:

SELECT * FROM OPENROWSET(
   BULK 'week3/inv-2017-01-19.csv',
   DATA_SOURCE = 'MyAzureInvoices',
   FORMAT = 'CSV',
   FORMATFILE='invoices.fmt',
   FORMATFILE_DATA_SOURCE = 'MyAzureInvoices'
   ) AS DataFile; 

我在 cmd 中使用了这个命令:

bcp [cpdb-dev].dbo.mykiosk_temp format nul -c -f C:\Users\BB-Pa\BCP\mk_data.fmt -T

但是报错:

"'bcp' is not recognized as an internal or external command, operable program or batch file."

需要单独安装bcp吗?

错误表明,您的环境变量中的 PATH 有问题。

"'bcp' is not recognized as an internal or external command, operable program or batch file."

您可以通过在环境变量设置中设置正确的路径来解决上述错误。

BCP_PATH = ODI_HOME\oracledi\client\odi\bin\odi.conf需要在环境变量设置中加入

参考 - https://community.oracle.com/tech/apps-infra/discussion/4140433/bcp-is-not-recognized-on-odi-12c