Re: Selecting "special" characters from a table

From: <James>
Date: Tue, 28 Feb 1995 15:43:07 GMT
Message-ID: <1995Feb28.154307.7092_at_newton.ccs.tuns.ca>


In article <rocky.793438048_at_lancelot.st.nepean.uws.edu.au> rocky_at_arthur.st.nepean.uws.edu.au (Rocqueforte OLeary) writes:
>G'day,
>
>A fairly simple problem. I have a table with a varchar field ("Name"),
>into which I wish to put the name "O'Leary". How do I escape the ' character
>so sqlplus doesn't interpret it as the end of the column ?
>Likewise, how do I do a select * from table where name = "O'Leary" ?
>
>Thanks to anyone who can solve this!
>--
>*** Rocqueforte "Rocky" O'Leary *** CSO,DBA,BOFH *** B.App.Sci.(Comp, Hons) ***
>** Work: Uni Of Western Sydney,Nepean, AU * email:rocky_at_st.nepean.uws.edu.au **
>** Tel: 047 360156 *** WWW:http://www.st.nepean.uws.edu.au/~rocky/index.html **
>***** "Baldrick, you can have a day off when you are dead" ~ E.Blackadder *****

If your in a form, data entry would accept it without any problems. From plus, do a double single quote.
i.e. SELECT NAME FROM TABLE WHERE NAME LIKE '%O''Leary%'; This would be interpreted as %O'Leary%

James Richard (JRICHARD_at_TUNS.CA)
"No Assembler Required!" Received on Tue Feb 28 1995 - 16:43:07 CET

Original text of this message