2021年3月12日星期五

Why h2 database have data conversion error converting

I have problem with h2 database.

I try to into values to the database like this

INSERT INTO INGREDIENT(id,name,type) values ('FLTO','pszenna','WRAP');  

But then i got this error

Data conversion error converting "'WRAP' (INGREDIENT: ""TYPE"" INTEGER)"; SQL statement:

also when i do smth like down my query is working

INSERT INTO INGREDIENT(id,name,type) values ('FLTO','pszenna','3');  

but in schema.sql file the type field is varchar so why this doesnt working

create table if not exists Ingredient (    id varchar(4) not null,    name varchar(40) not null,    type varchar(10) not null  );  
https://stackoverflow.com/questions/66608684/why-h2-database-have-data-conversion-error-converting March 13, 2021 at 07:49AM

没有评论:

发表评论