At 03:49 PM 10/28/2003, you wrote:
Is it possible to define required fields in a MySQL table?
By that I mean if the row is updated and the field value is still null, the update for the row is rejected and an error is produced.


The "NOT NULL" clause in the table definition simply converts NULL values to '' or zero for string and numeric fields. This only makes things worse because now it is harder to spot invalid data because the zeroes and '' blends in with valid data.

So I need the update to fail so I can keep invalid data (NULL's) out of the table. Any idea on how to do this? TIA

Mike


Oops. I should point out that it is the "Load Data Infile" that is allowing the NULL values to be converted to '' or zero. The SQL Insert statement (if I had used it) will catch the NULL's and prevent the row with NULL from being entered. But not "Load Data Infile".


So is there a way to get the "Load Data Infile" to respect the "Not Null" definitions? TIA

Mike



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to