On 18 Apr 2014, at 5:28pm, Dominique Devienne <ddevie...@gmail.com> wrote:

> I'm not sure where you get that declaring a column as varchar()
> implicitly truncate

While I can't find any reference one way or another in a SQL standard, all 
implementations I've seen that understand VARCHAR(n) truncate for any column 
defined with a number inside the brackets:

<http://msdn.microsoft.com/en-us/library/ms176089.aspx>

"When character expressions are converted to a character data type of a 
different size, values that are too long for the new data type are truncated. "

<https://dev.mysql.com/doc/refman/5.0/en/char.html>

"If strict SQL mode is not enabled and you assign a value to a CHAR or VARCHAR 
column that exceeds the column's maximum length, the value is truncated to fit 
and a warning is generated."

('warnings' in MySQL are not an indication of failure and are routinely 
ignored.)

SQLite is unusual in that it ignores the number in the brackets.  I don't know 
what various implementations do for just VARCHAR or for VARCHAR() with no 
number inside the brackets.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to