Delphi - Single Quote in string
<p>I am trying to populate a string variable to use in a TQuery.</p>

<p>How do I get a single quote in a string variable. In the following code the ShowMessage comand displays the CompName correct as 'TestComp" but the value in sql_str is ''TestComp''? </p>

<p>I have tried using QuotedStr.</p>

<pre><code>  CompName := 'TestComp';
  ShowMessage('SELECT datname FROM pg_catalog.pg_database WHERE     lower(datname) = ''' + CompName + '''');
  sql_str := 'SELECT datname FROM pg_catalog.pg_database WHERE lower(datname) = ''' + CompName + '''';
</code></pre>