Hi,
If your data is of a fixed size you can use SUBBITSTR(bytes,0,length_in_bits) to select the correct number of bytes from the LSB end and removed the extra byte that teradata adds to the MSB end.
so,
-- Teradata adds a null byte when the Most Significant Bit is 1
-- This makes no sense
-- SUBBITSTR will select the 20bytes from the LSB end to work around this
SUBBITSTR(
-- Convert to BYTES as this will take half the storage vs. storing HEX in VARCHAR
TO_BYTES(
--TO_BYTES expects UNICODE string hash_sha1 provides LATIN
TRANSLATE(hexstring_20_bytes_long USING LATIN_TO_UNICODE),
'base16'
)
,0,160
)
Regards,
Mark
Hi,
If your data is of a fixed size you can use SUBBITSTR(bytes,0,length_in_bits) to select the correct number of bytes from the LSB end and removed the extra byte that teradata adds to the MSB end.
so,
Regards,
Mark