Re: value by default 0
On Wed, 19 Dec 2007 14:12:31 +0100, Pierre Gilquin <inconnue@bluewin.ch>
wrote:
> Hi all,
>
>
> I have create a table A with a foreign key for a relation to table B.
> The relation must be benot null so the corresponding attribute is set as
> not null.
>
> If I create a new A with the foreign key null, the record is saved with
> a 0.
> I would expect that MySql would send me an exception without saving.
> How can I get the correct behaviour ?
It does limit the insert here.
Can you show use the CREATE TABLE syntax for both tables? (and does a key
with 0 exist in B, just to be sure?)
--
Rik Wasmus
|