Solved

Single Quote Escape Character

Posted on 2008-10-17
2
3,881 Views
Last Modified: 2008-10-17
Hi,

I was wondering what the escape charater for a single quote is in Sybase. i'm trying to do the below update statemwnt and one of the strings contains a persons name with a single quote! Thanks

UPDATE DESK SET nm_contact = 'M O'Leary' where id_desk = 1
0
Comment
Question by:bowemc
2 Comments
 
LVL 19

Accepted Solution

by:
grant300 earned 500 total points
ID: 22741190
The escape for a single quote is an additional single quote.

The problem you will have is trying to escape single quotes on the fly.  There was another question about how to do that not too long ago and the best answer I could come up with was to use a recursive function.  Slow and not available prior to v15 unless you ahve the Java option bought and paid for in 12.x

I would take a much simpler approach: turn off quoted identifiers and use double quotes around the outside of the text.

Regards,
Bill
0
 

Author Comment

by:bowemc
ID: 22743092
The escape for a single quote is an additional single quote. >> Perfect :-), Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In order to fulfill our mission of inspiring learning in the technology community, Experts Exchange is launching a Course of the Month program. Premium and Team Account members will have access to one course per month as a part of their membership, …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question