How to check the table definition or view definition of table in Teradata
Contents
SHOW Table :
Some time we want to check the table definition such as number of columns ,data type of the column,primary key ,unique constraints and so on. In that case, SHOW table helps to get the table definition in Teradata
Syntax for Show table:
1 |
SHOW TABLE Database_Name.Table_Name; |
Example for show table:
1 |
SHOW TABLE Banking_DB.Cust_Transaction; |
Output:
Show View:
Show view is used to check the view definition of the table.Basically view is created on top of the table.We can restrict the user to view only few columns from table by using view. We can create many view on the same table to restrict the different user to view different columns.
Syntax for Show view:
1 |
Show view view_name; |
Example for show view:
1 |
SHOW VIEW Banking_view.Cust_Transaction; |
Output:
Show Function :
Teradata allows to create the user defined function to perform the specific operation on the column values such as format the date or timestamp, modify the string and so on.Show function helps to view the implementation of those user defined functions.
Syntax for Show function:
1 |
Show Function function_name; |
Recommended Articles
- Teradata create table syntax with examples
- How to create a view for a table in Teradata?
- Add a new column to table using Alter table statement in Teradata