How to retrieve Metadata info using TPT API?

Database

How to retrieve Metadata info using TPT API?

I am using Teradata PT APIs to create a connector from my application. I want to do following tasks, but couldn't find a direct way to do this thro' APIs?

1-Get list of all the databases from a Teradata server
2-Get list of all the tables, views from a Teradata DB
3-Get list of all the fields(with their names, data types etc...) from a table/view

Any ideas would be appreciated.
2 REPLIES
Enthusiast

Re: How to retrieve Metadata info using TPT API?

1-Get list of all the databases from a Teradata server

Select databaseName from dbc.databases where dbkind='D'

2-Get list of all the tables, views from a Teradata DB

Select tablename from dbc.tables where databasename=:databaseName and
tablekind in ('T','V')

3-Get list of all the fields(with their names, data types etc...) from a table/view

select columnName,tableName from dbc.columns where databasename=atabaseName
Enthusiast

Re: How to retrieve Metadata info using TPT API?

I do not know if you are really asking about the below information
1-Get list of all the databases from a Teradata server

Select databaseName from dbc.databases where dbkind='D'

2-Get list of all the tables, views from a Teradata DB

Select tablename from dbc.tables where databasename=:databaseName and
tablekind in ('T','V')

3-Get list of all the fields(with their names, data types etc...) from a table/view

select columnName,tableName from dbc.columns where databasename=atabaseName

Sushant Paricharak
Teradata Certified Professional