Ravindra Kumar
Ravindra Kumar

Reputation: 1940

MySQL: #1292 - Truncated incorrect DOUBLE value: '...'

I'm trying to create a MySQL query to update PAN no of all members.

Using the query below I keep getting this error and its not something I've come across before, google seems to offer a variety of answers but I'm unable to relate the fix to my query.

UPDATE if_membermaster SET PAN_No = 'ABCD1234D' WHERE 'MemberCode'  = 5100

Result:

ERROR:- #1292 - Truncated incorrect DOUBLE value: 'MemberCode'

MemberCode is int(9) DEFAULT NULL.

Can any one help to fix this ?

Upvotes: 1

Views: 5873

Answers (1)

Salman Arshad
Salman Arshad

Reputation: 272106

You are using wrong quotes (PEBCAK). The where clause is comparing the string 'MemberCode' with 5100. This forces MySQL to convert both values to double hence the warning. Change single quotes to backticks:

UPDATE if_membermaster SET PAN_No = 'ABCD1234D' WHERE `MemberCode` = 5100

Upvotes: 2

Related Questions