Reputation: 2256
I am working w the Teradata SQL Assistant. What I am trying to do, is to list all databases visible in the 'Database Explorer'. At first, I have tried simple query:
select DatabaseName from DBC.Databases;
but this returned thousands of databases I don't even have an access to. The DBC.Databases table seems not to have any field allowing me to filter results to only visible databases, or I am just unable to find it. And I am almost sure there is no such field in any table like '%database%'.
Is there any way to list those visible databases with SQL query?
Upvotes: 1
Views: 5730
Reputation: 60472
Never use a system view without a trailing V
or VX
, those are old legacy views which will truncate object names over 30 characters.
In your case you need to switch to dbc.DatabasesVX
, the X
indicates that all objects where you don't have any access right are filtered automatically. But this might still return more databases than Database Explorer where you can add databases to the list manually.
Upvotes: 3