Ajit Kumar Singh
Ajit Kumar Singh

Reputation: 378

H2 Db, Column " not found" exception

I am getting "JdbcSQLSyntaxErrorException: Column "REAL" not found" exception on inserting a record in the H2 Db table from an Springboot project.

My query is:

INSERT INTO `bharatqr_provider_config` (`id`, `provider_name`, `provider_base_url`, `provider_username`, `provider_password`, `provider_key`, `status`, `created_by`, `created_time`, `lock_id`, `modified_by`, `modified_time`, `timezone`, `auto_check_status_enabled`, `upi_check_status_enabled`,`terminal_type`,`qr_type`) VALUES (1,'HDFC', 'http://localhost:6061','','','','ACTIVE','me','2017-12-06 15:23:42',1,'me', '2017-12-06 15:23:42','IST', 0, 1,"REAL","INTERNAL"), (2,'DUMMY','http://localhost:6061','me','me','me','ACTIVE','me', '2018-01-10 12:24:03',1,'me','2018-01-10 12:24:03', NULL, 0, 0,"NONE","INTERNAL");

From the exception It's saying that Column "REAL" not found", But "REAL" is not the column name it's a value which have to insert in the column terminal_type.

Upvotes: 1

Views: 664

Answers (1)

Evgenij Ryazanov
Evgenij Ryazanov

Reputation: 8178

"REAL" and "INTERNAL" are not values, they are identifiers in every standard-compliant database system.

Character string literals in SQL are surrounded by single quotes, you need to write them as 'REAL' and 'INTERNAL'.

Upvotes: 1

Related Questions