Page 1 of 1

Colon inside quotes inside apostrophe in WHERE error

Posted: Mon 21 Sep 2015 15:09
by sotmihgeo
Hello, i have an unusual case that generates an error "no value for parameter...". The query is like:

Code: Select all

select * from table where field='"title:description"'
If i execute it in IBExpert it works just fine. If i drop the quotes it works (the colon inside apostrophes only). I use Delphi7 with dbexpida 4.4.6.0

Re: Colon inside quotes inside apostrophe in WHERE error

Posted: Tue 22 Sep 2015 05:58
by ViktorV
Unfortunately, we couldn't reproduce the problem. To investigate the problem, please compose a small sample reproducing the problem and send it to viktorv*devart*com, including scripts for creating database objects.

Re: Colon inside quotes inside apostrophe in WHERE error

Posted: Tue 22 Sep 2015 07:20
by sotmihgeo
Hello Viktor. Thanks for such a quick reply. Unfortunately (for me) the problem is caused by ParseSQL in DB.pas. The Literals array holds the delimiters for text values inside the sql command. The array contains both quotes and apostrophes as text values delimiters so instead of treating

Code: Select all

'"title:description"'
as a text it treats

Code: Select all

'"
as a text and

Code: Select all

title:description
as syntax.

Re: Colon inside quotes inside apostrophe in WHERE error

Posted: Tue 22 Sep 2015 08:31
by ViktorV
To solve the problem, please try to use parameters instead of string constants. For example:

Code: Select all

  SQLQuery.SQL.Text := 'select * from table where field = :field';
  SQLQuery.ParamByName('field').asString := '"title:description"';