-1
I created a table GrupoDesconto
, with three fields: Id
, Descricao
and MargemDesc
.
On the table Revenda
, created a foreign key (Foreign key) GrupoDescontoId
who receives the id
of GrupoDesconto
and default 1
.
When rotating the table Revenda
already populated, I observed that the column GrupoDescontoId
was null
and not with value 1
.
What should I do?
cry, if not filled when inserting no option
– Sorack
Place DEFAULT in the VALUES list at the position corresponding to the field. In your case: ... VALUES(Group value_discount, DEFAULT)
– anonimo