Skip to main content
Inspiring
October 25, 2009
Question

MySQL Statement Problem (incorrect DOUBLE value)

  • October 25, 2009
  • 2 replies
  • 2929 views

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?

This topic has been closed for replies.

2 replies

Inspiring
October 27, 2009

Does MySQL support + as a string concatenation operator?  Or is it for performing addition on numerics?

--

Adam

Inspiring
October 26, 2009

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?

revdaveAuthor
Inspiring
October 27, 2009

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?