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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting Text Containing Single Quotes

Status
Not open for further replies.

vaishnu

Programmer
Oct 19, 2001
9
0
0
US
Hi,

I have a table and i have to insert a string
containing a value (Piping Fabrication Req't for P1's)
if I have to use FREETEXT how should I use it

Thanx in Advance
Vaishnu
 
I'm not sure about the FREETEXT question, but in general, you should use two ' marks to put a ' in your table. For example:

update mytable set myfield='example''s text'

myfield would be set to example's text.
Dave Robinder, MCSD
Programmer
Colorado DataScapes
Colorado Springs, CO
(719) 328-1111
 
Vaishnu,
If you're doing an INSERT or UPDATE before passing your SQL string replace all single ticks ' with double ticks ''. Then when the data is placed into the column it will show up as a single tick.

Selecting out of your table with FREETEXT or just a regular SELECT statement do a replace on the WHERE to replace any single ticks with double ticks that the SQL string contains.

I hope this clears the air for you.

Craig
 
Yes It works!!
Thank you very much for your suggestions

Regrads
Vaishnu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top