简体   繁体   English

粘贴SQL脚本时db2中的SELECT DISTINCT命令出错

[英]Error in SELECT DISTINCT command in db2 when pasting the SQL script

I have this error when I paste my SQL script on the db2 command line, 我在db2命令行上粘贴SQL脚本时出现此错误,

SQL3022N An SQL error "-104" occurred while processing the SELECT string in the Action String parameter. SQL3022N处理Action String参数中的SELECT字符串时发生SQL错误“-104”。

SQL0104N An unexpected token "car.ID as "Car ID", car.SPEED as "S" was found following "SELECT DISTINCT ". Expected tokens may include: "(space)". SQLSTATE=42601 SQL0104N在“SELECT DISTINCT”之后发现了一个意外的令牌“car.ID as”Car ID“,car.SPEED为”S“。预期的令牌可能包括:”(space)“。SQLSTATE = 42601

this is my SQL script: 这是我的SQL脚本:

EXPORT TO car.csv OF DEL SELECT DISTINCT car.ID as "Car ID", car.SPEED as "Car SPEED", .. 出口到car.csv的DEL SELECT DISTINCT car.ID为“Car ID”,car.SPEED为“Car SPEED”,..

I am not really sure what the error is. 我不确定错误是什么。 I've been deleting stuffs on my code too to check if it would change the error, but it's still the same. 我一直在删除我的代码上的东西,以检查它是否会改变错误,但它仍然是相同的。 What might be wrong on this? 这可能有什么问题?

Try to escape the 试着逃避

"

liKe in my example here: 我在这里的例子中说:

db2 "export to test.del of del select empno as \"Employee Number\" from employee "

The error is from your assigned column names: 错误来自您指定的列名:

change: Car ID => Car_ID 更改:车ID => Car_ID

Car SPEED => Car_SPEED 汽车速度=> Car_SPEED

EXPORT TO car.csv OF DEL SELECT DISTINCT car.ID as Car_ID , car.SPEED as Car_SPEED, ..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM