Significance of MaxLength column

Database
Vga
Enthusiast

Significance of MaxLength column

What is the significance of MaxLength column in HELP TABLE command in TD? In my case, I could see the value as 4 for an Integer column. While I select the max (column_name) from table, the o/p comes as 1234567 i.e. more than 4 in length...

Help me with that ...

Tags (1)
3 REPLIES
Supporter

Re: Significance of MaxLength column

Max number of bytes used to store the values

Enthusiast

Re: Significance of MaxLength column

As you would know Max(Column_name) will give you the maximum value present for that column in the table.

MaxLength is different from max function. It indicates the number of bytes used for storage of the particular datatype. For example Integer data types needs 4 bytes of storage.

MaxLength for other commonly used data types is as follows:


- Integer Date (4)


- CHAR (N, where N < 256)


- BYTEINT (1)


- SMALLINT (2)


- INTEGER (4)


- FLOAT/REAL (8)


- DOUBLE (8)


- DECIMAL (1, 2, 4 or 8)


Hope this helps!


PT

Enthusiast

Re: Significance of MaxLength column

Integer data type requires 4 bytes.The data value range is from -2,147,483,648 to 2,147,483,647

Stalin