Hi Olaf, all !

Olaf Stein wrote:
Hi All

If I have a column
`consent` enum('Y','N','P') default NULL,

And I try to insert 'NULL' I get this error:

Warning: Data truncated for column 'consent' at row 1

What is the problem there?

Double-check your command:
'NULL' is a string of four (4) letters, NULL is a keyword denoting the unknown value. I suspect MySQL receives a character string of 'N', 'U', 'L', 'L' (in one string) and truncates this to the first character, because this matches the column definition.


What I am doing is moving data from one table to another with a python
script so I have to assign 'NULL' to the variable in the insert string (at
least to my knowledge) because python retrieves "None" (type <type
'NoneType'>) when querying a NULL value.

I cannot comment on that.


HTH,
Jörg

--
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com


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

Reply via email to