minotaur01
asked on
MySQL conditional field update
I trying to create an update statement that update a single field in two different ways.
Here is what i have so far:
UPDATE service_surveys SET notes = IF(notes IS NULL, CONCAT(notes, ?nts), CONCAT(notes, '\n', ?nts)) WHERE id = {An ID}
The statement executes without throwing any errors but the field dose't update. Basically i trying to add string data to the existing string data and add a newline between the two strings only if there is already a string data present.
I'm using ASP.net with the MySQL Connector and a parameter for passing the data.
Here is what i have so far:
UPDATE service_surveys SET notes = IF(notes IS NULL, CONCAT(notes, ?nts), CONCAT(notes, '\n', ?nts)) WHERE id = {An ID}
The statement executes without throwing any errors but the field dose't update. Basically i trying to add string data to the existing string data and add a newline between the two strings only if there is already a string data present.
I'm using ASP.net with the MySQL Connector and a parameter for passing the data.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER