How to find the maximum length of a column

Database
N/A

How to find the maximum length of a column

Hi

I have a few Decimal, Character and Integer columns in my table. How may I write a query in Teradata to get the maximum permissible characters/digits in each of those columns? Please help this newbie.

Thanks and regards
Abhishek
Tags (4)
2 REPLIES
WAQ
Enthusiast

Re: How to find the maximum length of a column

SELECT ColumnName, ColumnType, ColumnLength
FROM DBC.COLUMNS
where TableName = 'YourTableName';
Enthusiast

Re: How to find the maximum length of a column

show table TableName;

It will print DDL of your table with types of each field.
More carefull information see in SQL Reference: Data Types and Literals, docs are available on teradata's portal teradata.com