Page 1 of 1

TOraQuery get table name(s)

Posted: Thu 02 Jul 2009 01:14
by dados
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

Posted: Thu 02 Jul 2009 09:22
by Plash
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.