CompressValueList add blank spaces in DBC.Columns field

Database
Enthusiast

CompressValueList add blank spaces in DBC.Columns field

Hi all,

I'm writing here because I didn't find any previous entry that solve my strange problem.

1) I define a table that has a column with COMPRESS clause

CREATE MULTISET TABLE TEST_CMP_VALUE,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
FIELD_PI BIGINT NOT NULL,
FIELD_2 CHAR(12) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
FIELD_CMP CHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL COMPRESS ('EAD','EQ_CRED','FORM_BAS2','GROSS_BAL','LGD')
)
PRIMARY INDEX ( FIELD_PI );

2) When I do the SHOW TABLE statement the COMPRESS list is shown, but each value inside the list has some trailing spaces

show table TEST_CMP_VALUE

CREATE MULTISET TABLE D_DDM_CLM_WORK.TEST_CMP_VALUE ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
FIELD_PI BIGINT NOT NULL,
FIELD_2 CHAR(12) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
FIELD_CMP CHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL COMPRESS ('EAD ','EQ_CRED ','FORM_BAS2 ','GROSS_BAL ','LGD '))
PRIMARY INDEX ( FIELD_PI );

3) I looked into the DBC.ColumnsV view to see which value is stored into the CompressValueList of the table DBC.tvfields.

As imagined, the trailing spaces are also there, as you can see here below!

('EAD                           ','EQ_CRED                       ','FORM_BAS2                     ','GROSS_BAL                     ','LGD                           ')

Am I missing something?

I tried the same test on 14.10.03.03 and 14.10.04.06 and the result is the one described above.

Do you know if this is correct?

Thank you in advance.

Regards.

3 REPLIES
Enthusiast

Re: CompressValueList add blank spaces in DBC.Columns field

It is correct,

You are compressing a Char(30) field so 30 chars are being compressed.

Consider using Varchar.

Rglass

Junior Contributor

Re: CompressValueList add blank spaces in DBC.Columns field

FIELD_CMP is defined as CHAR(30), of course values are padded with blanks.

Enthusiast

Re: CompressValueList add blank spaces in DBC.Columns field

You're right, now everything it's clear...

I was blind and didn't see that! :(