Description:
1::::. What did I try to do
I tried to update a record in a proposal table. I received an error. THe SQL statement looks fine to me. Could it be a bug?
Listed below is the SQL statement and table description:
update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1
| proposal | CREATE TABLE `proposal` (
`proposal_id` mediumint(9) NOT NULL AUTO_INCREMENT,
`user_id` varchar(50) NOT NULL,
`session_id` varchar(50) NOT NULL,
`title` varchar(100) NOT NULL,
`method` varchar(50) DEFAULT NULL,
`rational` text,
`file_name` varchar(100) DEFAULT NULL,
`create_date` date NOT NULL,
`status` varchar(20) NOT NULL,
`comment_to_author` text,
`commettee_user_id` varchar(50) DEFAULT NULL,
`committee_decision_date` date DEFAULT NULL,
`psi_center` varchar(50) DEFAULT NULL,
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`proposal_id`),
KEY `user_id` (`user_id`),
CONSTRAINT `proposal_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 |
2::::. What is my expectation:
I expected that the record is updated with new value
3::::. What is the problem:
Received the following error:
update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1 Column count doesn't match value count at row 1
java.sql.SQLException: Column count doesn't match value count at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
How to repeat:
Run the SQL statement at the command line. If you need the database dump file. Let me know. I can provide that to you.
update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1;
Description: 1::::. What did I try to do I tried to update a record in a proposal table. I received an error. THe SQL statement looks fine to me. Could it be a bug? Listed below is the SQL statement and table description: update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1 | proposal | CREATE TABLE `proposal` ( `proposal_id` mediumint(9) NOT NULL AUTO_INCREMENT, `user_id` varchar(50) NOT NULL, `session_id` varchar(50) NOT NULL, `title` varchar(100) NOT NULL, `method` varchar(50) DEFAULT NULL, `rational` text, `file_name` varchar(100) DEFAULT NULL, `create_date` date NOT NULL, `status` varchar(20) NOT NULL, `comment_to_author` text, `commettee_user_id` varchar(50) DEFAULT NULL, `committee_decision_date` date DEFAULT NULL, `psi_center` varchar(50) DEFAULT NULL, `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`proposal_id`), KEY `user_id` (`user_id`), CONSTRAINT `proposal_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 | 2::::. What is my expectation: I expected that the record is updated with new value 3::::. What is the problem: Received the following error: update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1 Column count doesn't match value count at row 1 java.sql.SQLException: Column count doesn't match value count at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) How to repeat: Run the SQL statement at the command line. If you need the database dump file. Let me know. I can provide that to you. update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1;