Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TFDQuery.Table.TableList.ItemsI[].Name Issue


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Apr 20, 2016 9:41 PM Last Post By: Dmitry Arefiev
Sistemas Avanza...

Posts: 1
Registered: 5/11/07
TFDQuery.Table.TableList.ItemsI[].Name Issue  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2016 11:54 PM
Hello,
I’m a Delphi Xe6+ programmer, specially focused on DataBase developing tools and software connectivity.
I trying to make a parsing piece of software using FireDac architecture mixed with DataSnap and I think I have some kind of issue with the properties of the TDFQuery component.

I set the SQL String property with this example query:

Select t1.colA, t2.colB
from table1 t1, table2 t2
where t2.colC=5

Very simple.

The problem comes where I try to parse the components of this query with this:
TableName1:=FDQuery1.Table.TableList.ItemsI[0].Name;
TableName2:=FDQuery1.Table.TableList.ItemsI[1].Name;

It is supposed that those two strings will be set to TableName1 = ‘table1’ and TableName2=‘table2’. But only ItemsI[0] contains information, and TableList.Count=1 and not 2 as it is supposed to.
Is there any bug in Table.TableList.ItemsI object structure?

Perhaps I’m doing something wrong or perhaps there is another way to get the names of the tables from the QueryString?
What in fact I’m trying to do is to retrieve a stringList with all the columns of all the tables included in a query and for that I need the table names before anything.

Many thanks in advance,
Stéphane.

Edited by: Sistemas Avanzados Telecom Levante S.L. on Apr 18, 2016 11:54 PM

Edited by: Sistemas Avanzados Telecom Levante S.L. on Apr 18, 2016 11:56 PM
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: TFDQuery.Table.TableList.ItemsI[].Name Issue  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 20, 2016 9:41 PM   in response to: Sistemas Avanza... in response to: Sistemas Avanza...
FDQuery.Table.Columns[].OriginTabName, OriginColName return table
name and column name. Depending on a database these properties
contain either real information, either OriginTabName is empty and
OriginColName contains SELECT list item name (alias).

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02