Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for tick mark

Status
Not open for further replies.

DirtyB

Programmer
Mar 13, 2001
159
US
Hi everybody...

I have a name field here and want to get rid of the "O'donnels". Can someone tell me the syntax for searching a column for a tick mark?

thanks
 
SELECT name_col
FROM my_table
WHERE INSTR(name_col,'''') > 0;

will bring up any name_col with a tick in it.
 
THANK YOU...that was quick too, need a job? :)
 
Hang on to that thought! I'm drowning in silliness where I am!
 
...And building upon Carp's fine solution, to preserve the readability of the "tick" mark, without dealing with the Oracle hassles of a tick mark, you can do the following:

UPDATE my_table
set name_col = replace(name_col,chr(39),chr(96)
where instr(name_col,chr(39)) > 0;

CHR(39) equals (') tick mark; CHR(96) equals (`) backward tick.
 
Sorry, on previous post, it should include a closing paren for the REPLACE function, to read as:
UPDATE my_table
set name_col = replace(name_col,chr(39),chr(96))
where instr(name_col,chr(39)) > 0;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top