德比中的SQL错误 - 错误42X01:语法错误:遇到“KEY”

时间:2015-01-09 06:38:55

标签: sql derby

以下查询会出现ERROR 42X01: Syntax error: Encountered "KEY" at line 1, column 48.

之类的错误

我无法理解究竟是什么问题。列KEY存在且数据类型为integer

Insert into UOM_TYPE 
(UNITS_OF_MEASURE_NO,TYPE,KEY,CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE,VERSION)
values 
(79,'Clinical Property',32,'JRL',DATE('2007-05-04'),'JRL',DATE('2007-05-04'),2);

请帮我解决问题

1 个答案:

答案 0 :(得分:2)

KEY是derby db中的关键字。你必须逃脱它:

Insert into UOM_TYPE 
(UNITS_OF_MEASURE_NO,TYPE,"KEY",CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE,VERSION)
values 
(79,'Clinical Property',32,'JRL',DATE('2007-05-04'),'JRL',DATE('2007-05-04'),2);