mysql: inserts even if the field declared not null

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

mysql: inserts even if the field declared not null

Post by raghavan20 »

In my database, I have almost all the important fields declared not null but for some unknown reason the database allows to update empty fields into the db.

I have never seen that happen in MSAccess or Oracle!!!

Could any of you tell me why? what to do with that?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I can give you only one advice: Use a real SQL DBMS like PostgreSQL...



With MySQL you simply don't have data integrity :( For example, MyQSL accepts 9999-99-99 as a date... and stores it as 0000-00-00.. Imho, it should refuse to accept the date...
Post Reply