Guest_imported
New member
- Jan 1, 1970
- 0
I have a field of varchar in a table. I have defined it as follows along with other fields
xyz varchar(10).
I have inserted one row with 5 chars for this field so this field will occupy only 5 bytes or characters and I have inserted another record with 10 chars for this field so this field for this record will occupy only 10 bytes or characters
Now i give a select on this table for all rows i.e. select * from abc.
In spufi it will show 2 records with the first record showing 5 chars and 5 spaces for this field and for second record it will show the 10 characters. What I wanted to know is that how do I know a that how many fields is a varchar field occupying for each record.
I heard that DB2 stores 2 bytes for each record's varchar's field. So that 2 bytes contains information about the length of the bytes occupied by the varchar variable. So if this is correct how can we see that 2 bytes of information.
xyz varchar(10).
I have inserted one row with 5 chars for this field so this field will occupy only 5 bytes or characters and I have inserted another record with 10 chars for this field so this field for this record will occupy only 10 bytes or characters
Now i give a select on this table for all rows i.e. select * from abc.
In spufi it will show 2 records with the first record showing 5 chars and 5 spaces for this field and for second record it will show the 10 characters. What I wanted to know is that how do I know a that how many fields is a varchar field occupying for each record.
I heard that DB2 stores 2 bytes for each record's varchar's field. So that 2 bytes contains information about the length of the bytes occupied by the varchar variable. So if this is correct how can we see that 2 bytes of information.