Tuesday, March 20, 2012

Quotations in this sql statement

I'm having trouble getting the quotations right in this sql statement because of the single quotes in the displayname. It keeps breaking my application. How would you use quotes to get this to work?

Select description from lawschools_tbl where displayname='Certificat, L'Institut d'études Politiques/'

When you need to use a quote ' in a SQL String, you need to replace the single quote with two single quotes.

Select description from lawschools_tblwhere displayname='Certificat, L''Institut d''études Politiques/'
|||

Actually I was making it too hard. thanks for your help though with the sql syntax.

No comments:

Post a Comment