isolating the where clause

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
yarivk
Posts: 3
Joined: Thu 03 Apr 2008 22:08
Location: California

isolating the where clause

Post by yarivk » Thu 03 Apr 2008 22:20

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

yarivk
Posts: 3
Joined: Thu 03 Apr 2008 22:08
Location: California

simple solution..

Post by yarivk » Thu 03 Apr 2008 22:41

uses system

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

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

Post by Plash » Fri 04 Apr 2008 07:39

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.

yarivk
Posts: 3
Joined: Thu 03 Apr 2008 22:08
Location: California

Post by yarivk » Thu 10 Apr 2008 21:10

Very elegant, and works great, Thank you!

Post Reply