I'm trying to find some information about the number of bytes that are used to store data in my table when I have a column defined with VARCHAR(100) ALLOCATE(60) but I'm not having much luck and I'm not convinced on the wording in the answer ChatGPT is giving me.
If I have a column defined with VARCHAR(100) ALLOCATE(60) then how many bytes would be used with the following data?
- Data that is 60 characters long. Does this take 62 bytes?
- 60 characters stored in the fixed area
- 2 bytes for the length
- Data that is 80 characters long. I think this takes 90 bytes.
- 60 characters stored in the fixed area
- 2 bytes for the length
- 20 characters in the overflow area
- 8 bytes for the pointer to the overflow
The bit that I'm not sure about is in 1. above.
Will each row in my table require space for the pointer to the overflow even if the length of the data does not exceed the ALLOCATE length?
The reason I'm asking is that I need to extend an existing CHAR(60) column and I'm planning to convert this to a VARCHAR but wanted to understand roughly how much additional storage the data would be using.
------------------------------
Richard Moulton
------------------------------