0

Hi there here is a stupid question. I have created an update statement that updates a table that has null user id using a name as the identifier:

UPDATE dembel
SET userid = 8908
WHERE [Name] = 'o'reily'

However the the name already contains an apostrophe which causes a problem in sql, How can i write the name so that the apostrophe is part of the string itself.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Aussie_Here
0

Something like that might work:

UPDATE dembel

SET userid = 8908

WHERE [Name] = 'o''reily'

But before doing that you need to replace the name in ur db with double apostrophe using Replace:

Replace ("o'reily", " ' ", " '' ")
0

Something like that might work:

UPDATE dembel

SET userid = 8908

WHERE [Name] = 'o''reily'

But before doing that you need to replace the name in ur db with double apostrophe using Replace:

Replace ("o'reily", " ' ", " '' ")

Why would he replace the data with a double apostrophe? That's changing the integrity of the data, which I don't think he wants.

0

That's one solution and if he doesn't want it he could do sth else but do u have any suggestion in this regard?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.