title: How do I set a sql query parameter in Delphi that contains an '@'
body: <p>I am querying a database using an email address. The address is like fred.o'neill@smxi.com</p>
  <p>In Delphi that looks like <code>fred.o''neill@smxi.com</code> as the apostrophe is escaped of course.</p>
  <p>Let's say the query is...</p>
  <pre><code>'select * from table where (email = ''%s'')'
  </code></pre>
  <p>Now if I just replace %s the query fails as it seems to see the value as 2 strings 'fred.o' and 'neill@smxi.com', i.e. it doesn't recognise the escape.</p>
  <p>If the query is...</p>
  <pre><code>'select * from table where email = :email' 
  </code></pre>
  <p>...then the parameter is set to the email address. It works if there is no apostrophe but doesn't match the data if the email address contains one.</p>
  <p>[edited to remove incorrect data]</p>
  <p>Any suggestions?</p>