MySQL Statement Problem (incorrect DOUBLE value)
Copy link to clipboard
Copied
Hi All,
The line below adds a comma and text to the end of the varchar field in MS SQL...
UPDATE thetable
SET
thefield = thefield+','+'#trim(Form.newitem)#'
Where id = 1
... but errors in MySQL 5 ...
Error Executing Database Query.
Data truncation: Truncated incorrect DOUBLE value: ','
BTW: I tried: thefield = thefield & ',' & '#trim(Form.newitem)#' --- but still errors out
Q: Is there a better way to write this statement for MySQL so it won't have an error?
Copy link to clipboard
Copied
Are you sure the field is varchar? Your error message suggests it's numeric.
Is there a better way? Probably. Why are you appending a comma plus new text to an existing value in the first place?
Copy link to clipboard
Copied
Hi Dan,
thefield is a varchar.
- i want the contents like :
2,1,44,234,5,6,23,108 etc...
it's easy when you say...
thefield = thefield+ .... cause you can add to the field right there without doing another search query first (to get contents)
Any Ideas how to better write this?
Copy link to clipboard
Copied
Does MySQL support + as a string concatenation operator? Or is it for performing addition on numerics?
--
Adam

