Compress text value NULL


Compress text value NULL



Will this compress an actual text value of NULL (i.e. 'NULL')?  I understand it doesn't make a whole lot of sense to store NULL as text, but this isn't my data so I can't do anything with it except suggest that they change it.

I've tried creating tables with Compress('NULL' and when I do a SHOW TABLE it returns it as COMPRESS('NULL ') with an extra space so I thought that was a little strange and 'NULL' is not equal to 'NULL ' as far as text goes so I should probably tell this company to reconsider storing NULL as a text value...

Also, are NULL values (not text) automatically compressed by Teradata or do you still need to COMPRESS keyword to compress NULL values?  I think you still need COMPRESS, but I would just want to verify.  

Thank you for your help!

Tags (2)
Senior Supporter

Re: Compress text value NULL

compress('NULL') will compress the String 'NULL' and any NULL as well as NULL is compressed in any case if a compress statement is given.