Filter strings with LIKE statements involving single quotation characters

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
datkins
Posts: 2
Joined: Sun 08 Jan 2006 10:10

Filter strings with LIKE statements involving single quotation characters

Post by datkins » Tue 20 Jun 2006 08:02

Hi,

Need to set the filter string to a LIKE string with a single quote in it, I guess there must be a real simpe way to get ODAC to do the ecsaping of the string for me but I can't fidn it, can any one advise ?

Thanks

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 21 Jun 2006 09:03

Two sequential apostrophes in a quoted string denote a single apostrophe. When you set Filter property from Object Pascal code you can use QuotedStr function. For example:

Code: Select all

  Filter := 'Name LIKE ' + QuotedStr('A''b*');

Post Reply