Discussion: value by default 0
Afficher un message
Vieux 19/12/2007, 14h25   #2
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
 
Page generated in 0,04427 seconds with 9 queries