There's two issues with this.
One. You're starting with a character column and you want to encrypt it
in place. We just went through FOR BIT DATA and DSPFFD calling it HEX
instead of CHARACTER.
Two. Size of encryption. If you were only storing 1 byte in let's say a
30 character field, maybe but that conversion to HEX may be enough to
cause a record format level check - not sure.
For more information on encryption size see also:
- Chuck showed you some math in his SQL explantion but I don't think he
explained the x+y+z or whatever it was.
- Infocenter. Length depends on encryption selected. For example
ENCRYPT_TDES uses the math:
The length attribute for the data type of data-string must be less than m
- MOD(m,8) - n - 1, where m is the maximum length of the result data type
and n is the amount of overhead necessary to encrypt the value.
More explanation on the overhead follows in infocenter.