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.
Tschau
Christian