TOraQuery get table name(s)

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dados
Posts: 82
Joined: Thu 18 Aug 2005 14:06

TOraQuery get table name(s)

Post by dados » Thu 02 Jul 2009 01:14

Hi,

In TOraQuery there are, for example, two functions to work with the SQL statement
OraQuery1.GetOrderBy
OraQuery1.AddWhere

But is there anything that can retreive the table name(s) in a select statement?

I'm really interested in retreiving the table name for a select statement, that user inputs, that is updateable....any ideas

Reg,
Arni

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

Post by Plash » Thu 02 Jul 2009 09:22

You can use the following code:

Code: Select all

var
  TablesInfo: TCRTablesInfo;
  i: integer;
...
  TablesInfo := TDBAccessUtils.GetIRecordSet(OraQuery1).TablesInfo;
  for i := 0 to TablesInfo.Count - 1 do
    ShowMessage(TablesInfo[i].TableName);
TCRTablesInfo is declared in CRAccess unit.

Post Reply