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
);
typecolumn is an integer, and it complains that it can't convert'WRAP'to integer. The second example works beacause'3'can be converted to3.createandinsertare applied to the same database; append;IFEXISTS=TRUE, as shown here to avoid creating spurious database files.