Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread GetTablesNames Method??
Tue, Jun 23 2020 3:25 AMPermanent Link

Ian Branch

Avatar

Hi Guys,
Will GetTableNames method return a Temp table if created?
Regards,
Ian
Tue, Jun 23 2020 9:55 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


>Will GetTableNames method return a Temp table if created?

I doubt it. Looking at the source I found two lines of interest

             TempStatementManager:=PrepareStatement('SELECT * FROM Information.Tables');
and
              TempStatementManager:=PrepareStatement('SELECT * FROM Information.Views');

and if you test the first select statement it doesn't show temporary tables.

I'm sure Tim had a good reason for doing it the way he has. If you want the lot I'd suggest a small query something like

SELECT LIST(What+': '+Name,#13) AS TsAndVs
FROM
(
select 'Table' AS What, name from information.tables
union
select 'View' AS What, name from information.Views
union
select 'Temp' AS What, name from information.temporarytables ) X

and stringlist.text := Fields[0].AsString

Roy
Wed, Jun 24 2020 4:47 PMPermanent Link

Ian Branch

Avatar

Tks Roy.
Image