All Forums Database
sikder 1 post Joined 12/10
28 Dec 2010
How to find the maximum length of a column


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

WAQ 158 posts Joined 02/10
28 Dec 2010

SELECT ColumnName, ColumnType, ColumnLength
where TableName = 'YourTableName';

teradater 29 posts Joined 11/10
28 Dec 2010

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

You must sign in to leave a comment.