gpt4 book ai didi

java - 错误 1136 (21S01) : Column count doesn't match value count at row 1

转载 作者:行者123 更新时间:2023-11-29 00:36:29 25 4
gpt4 key购买 nike

我有一个名为 incident_log 的表,它的结构是这样的

CREATE TABLE `incident_log` (
`il_id` int NOT NULL auto_increment,
`il_i_id` int default NULL,
`il_time_occured` datetime NOT NULL,
`il_status` varChar(255) NOT NULL default 'OPEN',
`il_prevstate` varChar(255),
`il_trigger` varchar(255),
`il_current_state` int NOT NULL default 0,
`il_prev_state` int NOT NULL default 0,
`il_current_trigger` int NOT NULL default 0,
`il_prev_trigger` int NOT NULL default 0,
`il_pol_as_status` mediumblob,
`il_obj_id` int,
`il_occuredCount` int default 0,
`il_reportedOccuredCount` int default 0,
`il_reportedCount` int default 0,
`il_cascadeReportedTime` bigint default 0,
`il_obj1` text,
`il_obj2` text,
`il_obj3` text,
`il_itype` enum('CRITICAL','EVENT') NOT NULL default 'CRITICAL',
`il_usrNotifyStatus` enum('NEW','NOTIFIED','NOT_NOTIFIED') NOT NULL default 'NEW',
`il_rootcause_il_id` int NOT NULL DEFAULT 0,
`il_rootcause_info` text DEFAULT NULL,
`il_rootcause_i_objclass` enum('DATASET','COMPONENT','SERVICE','SERVER','BCS') default NULL,
`il_rootcause_i_obj_id` int(11) default 0,
`il_acset_id` int default NULL,
`il_intRes1` int,
`il_intRes2` int,
`il_intRes3` int,
`il_intRes4` int,
`il_varcharRes1` varchar(64),
`il_varcharRes2` varchar(255) );

但是当插入下面的数据时它给了我一个错误

ERROR 1136 (21S01): Column count doesn't match value count at row 1
INSERT INTO incident_log  (il_i_id, il_time_occured, il_cascadeReportedTime,
il_occuredCount,il_obj_id, il_obj1, il_obj2, il_obj3,
il_status, il_rootcause_il_id, il_rootcause_info,
il_rootcause_i_objclass, il_rootcause_i_obj_id,
il_acset_id)
VALUES (1,'',0,0,12,'','','','OPEN',0,NULL,NULL,0,NULL);

请帮我解决这个问题..

最佳答案

我在您的创建表语法中发现了一些更正

  1. 应在主键中定义自增列
  2. 您在日期时间il_time_occured。通过错误不正确的字段插入 ''(空值)时。

插入语句没有错

这个查询工作正常。

INSERT INTO incident_log (il_i_id, il_time_occured, il_cascadeReportedTime, il_occuredCount,il_obj_id, il_obj1, il_obj2, il_obj3, il_status, il_rootcause_il_id, il_rootcause_info, il_rootcause_i_objclass, il_rootcause_i_obj_id, il_acset_id) VALUES (1,'2012-12-27 16:03:32',0,0,12,'','','','OPEN',0,NULL,NULL,0,NULL)

引用屏幕短片: enter image description here

See sqlfiddle demo.

关于java - 错误 1136 (21S01) : Column count doesn't match value count at row 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14052923/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com