Retrieve table name from field object (TField)
Posted: Thu 14 Jun 2018 09:07
Hi,
I am wondering if it is possible to retrieve the used table name from a processed query. In particular it would be nice to retrieve table names and columns from a dataset after a query has been processed.
For example I have the following query:
I tried getting the table name from each field by looping all fields after the query is processed. I found 'Origin' but this variable seems always empty. It would be nice to know which column belong to which table. In this case it would be easier to write data back to the specific tables in the database. I'm using a Microsoft SQL database.
Thank you in advance for your response.
I am wondering if it is possible to retrieve the used table name from a processed query. In particular it would be nice to retrieve table names and columns from a dataset after a query has been processed.
For example I have the following query:
Code: Select all
SELECT table1.id, table2.name, table2.value
FROM table1, table2
WHERE table table2.id = table1.id
Thank you in advance for your response.