Delphi - Single Quote in string

I am trying to populate a string variable to use in a TQuery.

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''?

I have tried using QuotedStr.

  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 + ''''; 

Replay

Category: delphi xe Time: 2016-07-29 Views: 0
Tags: delphi xe

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.127 (s). 12 q(s)