Importance of format 'X(n)' in varchar


Importance of format 'X(n)' in varchar

Hi ,

When we increase the column size using alter table, previous format is saved in the field. For Eg: When we increase size of a column say col1 from varchar(20) to varchar(200), the previous format , format 'X(20)' will still be used in the field definition,

When we use format 'X(200)' explicitly we will have the same format. Can anyone help me answer below questions?


1) Why previous format (X(20)) will still be used in the field definition. Any impact?

2) If we change the format explicitly to new format (X(200)) would there be any impact?

Basically wanted to know the importance of format'X(n)' ..

Teradata Employee

Re: Importance of format 'X(n)' in varchar

Because you didn't change it.

The default format is assigned only when a column is created without explicit FORMAT. Best practice is to simply ALTER the FORMAT in the same statement as the max length.

Default character format phrase is used primarily by "Field Mode", e.g. BTEQ reports, which will quietly truncate the data if you leave it with the shorter specification. Most client applications use "Record Mode" and ignore FORMAT.