Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Mysql – unknown column in 'field list'

Getting Error Code: 1054. Unknown column 'identification' in 'field list' using this simple insert:

insert into document (`title`, `patient_id`, `file_type`, `doc_type`, `identification`) 
    values ('VISA BLUE GRACE2.png', '122', 'image/png', 'document', '0');

Existing stackoverflow answers talk about using backticks vs. single / double quotes which I believe I’m doing correctly here.

Omitting the column from the insert is successful and adds the default value. What gives? I even reboot mysql because I did recently change that column name.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Table definition:

CREATE TABLE `document` (
  `id` int NOT NULL AUTO_INCREMENT,
  `patient_id` int NOT NULL,
  `title` varchar(100) NOT NULL,
  `file_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `doc_type` varchar(50) NOT NULL,
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `indentification` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=94 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

>Solution :

Table defintion has different column name indentification instead of identification(typo)
Referring to the appropriate column name will resolve this issue.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading