This is a copy from
http://forums.mysql.com/read.php?10,...3797#msg-73797.
Perhaps someone on this group will know the answer.
Given the following table:
CREATE TABLE foo(field VARCHAR(20) NOT NULL);
The following query *can not* be executed:
INSERT INTO foo VALUES(NULL);
That is the behaviour I expected. But why the following query *can* be
executed:
UPDATE foo SET field=NULL;
By executing the UPDATE query, fields in all rows become zero-length
strings. I would like the error to be thrown instead.
Is there a way to instruct MySQL, at run-time, to make UPDATE queries
strict, without implicit conversion?
I appreciate your answers.
Ċ½eljko
http://forums.mysql.com/read.php?10,...3797#msg-73797.
Perhaps someone on this group will know the answer.
Given the following table:
CREATE TABLE foo(field VARCHAR(20) NOT NULL);
The following query *can not* be executed:
INSERT INTO foo VALUES(NULL);
That is the behaviour I expected. But why the following query *can* be
executed:
UPDATE foo SET field=NULL;
By executing the UPDATE query, fields in all rows become zero-length
strings. I would like the error to be thrown instead.
Is there a way to instruct MySQL, at run-time, to make UPDATE queries
strict, without implicit conversion?
I appreciate your answers.
Ċ½eljko
Comment