Page 1 of 1

isolating the where clause

Posted: Thu 03 Apr 2008 22:20
by yarivk
I would like to isolate the where clause (FinalSql – BaseSql) and use it for a delete statement. Any ideas how to do it?

Thank you

simple solution..

Posted: Thu 03 Apr 2008 22:41
by yarivk
uses system

var s: String
s := FinalSQL;
Delete(s, 1, Length(BaseSql));

Posted: Fri 04 Apr 2008 07:39
by Plash
You can use the following code to get WHERE clause:

Code: Select all

  w := _GetWhere(IBCQuery.SQL.Text, TIBCParser, False, lxSELECT, lxWHERE);
You should add IBCParser unit to 'uses' to compile this code.

Posted: Thu 10 Apr 2008 21:10
by yarivk
Very elegant, and works great, Thank you!