List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:May 7 1999 6:01pm
Subject:Re: primary key is null ?
View as plain text  
Tati Sulastri wrote:
> hello...
> I am new in using mysql, forgive me if this question just disturbed you.
> I have a table with id as a primary key, as I knew a primary key never be
> a null (empty and zero), is that true ? . in mysql the default of the
> primary key is null so that if I insert  zero into the id, the id has zero
> value.
> how to make the mysql return a parse error when I set a zero value ?
> thanks...
> regards,
> tati

Hi Tati

What makes you believe, that a PRIMARY KEY can not contain zero?
Belive me it can!

Only if you have an AUTO_INCREMENT set on that PRIMARY KEY a zero value will be treated as
an automatic generation insert into this column.


mySQL won't start on FreeBSDHunter Hillegas7 May
  • primary key is null ?Tati Sulastri7 May
    • Re: primary key is null ?Christian Mack7 May
  • mySQL won't start on FreeBSDJani Tolonen12 May