2
I have a field in a table of celulas
who asks for the number of celula
that gave it origin.
Example: We have the table celulas
:
idCelula,
nome,
etc ...
origem
That one origin ago reference at the idCelula
of cell who created her (cell originating new cells).
It turns out that origem
is foreign key referencing idCelula
.
The problem: When we register the first cell, as there is not yet a origin, there will be a recording problem of hers in the Mysql.
Is there any clause case
for example to get around this problem?
yeah. that’s what I wouldn’t like. remove NOT NULL. But it will be the most viable!
– Carlos Rocha
Try to control the insertion through Stored Procedure, if it is the first insertion allows inserting without source, otherwise it does not allow.
– SpockWayne
good, but... how do you do it?
– Carlos Rocha