database - Merge query in H2 db showing null not allowed error -


merge query in h2 showing error null not allowed.

i have apple table 4 columns : id,type,name,status...where id , type cannot null (id being primary key).

i merging data of 2 columns "name , status" using merge command...

merge apple(id,name,status) key (id) select id,name,status fruit ; 

it gives error showing null not allowed column "type".

i dont know going wrong.i have 1 entry in apple table contains valid "id" , "type" already.

my fruits table not have type column , neither including in query why showing problem particular column???

if table contains column type can not null (as wrote), have provide value column in statement:

merge apple(id,name,status,type) key (id) select id,name,status,0 fruit ; 

as alternative, can specify default value when creating table.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -