sql update statement

I need to run this update statement

UPDATE SIEBEL.EIM_ADDR_PER SET AP_COUNTRY = 'Korea, Democratic People's Rep'

the problem comes in with the "People's" the statement recognizes the 's as the end.

Thanks for your help.
Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
UPDATE SIEBEL.EIM_ADDR_PER SET AP_COUNTRY = 'Korea, Democratic People''s Rep'
rrisalAuthor Commented:
angellll thanks for the suggestion but when i run that the result i get is

Korea, Democratic People''s Rep

The desired result i was looking for was just one quotation

Korea, Democratic People''s Rep

Is there a way to do this? Thanks.
erikTsomikConnect With a Mentor System Architect, CF programmer Commented:
i AGRRE WITH angelIII. The problem is apostrphies
you can also try something like this I am not sure about syntax but it is something like that
declare @str as varchar;
declare @str2 as varchar;
Set @str='Korea, Democratic People's Rep'
set @str2=replace(@str,"'", "''")
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

escape character in mysql is backslash (\)

UPDATE SIEBEL.EIM_ADDR_PER SET AP_COUNTRY = 'Korea, Democratic People\'s Rep'

angelIII is in mssql mode :)
johnsoneConnect With a Mentor Senior Oracle DBACommented:
In angelIII's response, that is two single quotes, not a double quote.

Escaping a single quote will not work.  You should get a ORA-01756 with steelseth12's query.

The other way to do it is this:

UPDATE SIEBEL.EIM_ADDR_PER SET AP_COUNTRY = 'Korea, Democratic People' || chr(39) || 's Rep'
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>angelIII is in mssql mode :)
the '' (2 single quotes) will also work in Oracle...  the chr(39) "trick" is not needed, but will work also in oracle.
Muhammad WasifCommented:
You can escape a single quote with another single quote too.
Muhammad WasifCommented:
angelIII already explained it :-)
johnsoneSenior Oracle DBACommented:

I know the chr(39) trick is not needed and the two single quotes works.  I was just giving another alternate.  I prefer your solution.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.