Guest_imported
New member
- Jan 1, 1970
- 0
I want to know that in a table abc there is a field memo which is varchar(30). And when the user enters the data in the table, its not always of 30 characters since memo field can contain data which is not fixed sometimes it can be of 15 characters and sometimes it can be 30 characters. So when we are inserting a row with 15 bytes for this field then DB2 will take only 15 bytes of space for this field since it contains only 15 characters.Similarly when we are inserting a row with 30 bytes for this field then DB2 will take all the 30 bytes of space for this field since it contains 30 characters. So when I select all the rows using SPUFI or File-Aid, for first record it shows me 15 bytes of data which we entered and rest 15 as spaces, and for second record it shows whole 30 bytes of data. So if I insert a record with first 20 bytes with some data and the last 10 bytes with spaces.Then DB2 will use 30 bytes for this field since the first 20 bytes have some data and the last 10 has spaces. DB2 will store that 10 bytes also. But when I select this record using SPUFI or File-Aid it will show 20 bytes of data and 10 bytes as spaces, i.e. the way in which we stored the data.
What I wanted to know is that how can I know that the first record which has been inserted is using only 15 bytes of space. In file-Aid the record will be shown as first 15 bytes will have the data and the rest will have spaces (i.e. while showing in SPUFI or File-Aid for that record). How do I know how many bytes is this varchar field occupying in the memory i.e. on the hard disk or whatever medium DB2 stores data on.
What I wanted to know is that how can I know that the first record which has been inserted is using only 15 bytes of space. In file-Aid the record will be shown as first 15 bytes will have the data and the rest will have spaces (i.e. while showing in SPUFI or File-Aid for that record). How do I know how many bytes is this varchar field occupying in the memory i.e. on the hard disk or whatever medium DB2 stores data on.