Column and other table metadata information in Teradata dbc tables

All Teradata system tables are stored under DBC schema.

\n\n


For columns, it is dbc.columns

\n\n
select * from dbc.columns\n
\n\n

For views, it is dbc.tables with a filter on a column something named table_type 'V' (where V stands for Views)

\n\n
select * from dbc.tables where tablekind = 'V'\n
\n\n

In Teradata DBC.Tables contains many of the objects that exist on the system. (e.g. Stored Procedures, UDF, Triggers, Macros, Views, Tables, Hash Index, Join Index, etc.) The column Table Kind is used to identify the type of object.

\n\n
SELECT *\nFROM DBC.TABLES\nWHERE TABLEKIND = '<see below>'\n\nA = Aggregate Function\nB = Combined Aggregate Function and ordered analytical function\nD = JAR\nE = External Stored Procedure\nF = Standard Function\nG = Trigger\nH = Instance or Constructor Method\nI = Join Index\nJ = Journal\nM = Macro\nN = Hash Index\nO = No Primary Index (Table)\nP = Stored Procedure\nQ = Queue Table\nR = Table Function\nS = Ordered Analytical Function\nT = Table\nU = User-defined data type\nV = View\nX = Authorization\nY = GLOP Set\n


dan-irving

posted on

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds