I think I have seen somewhere that there is some sort of semantic difference between CHAR(n) FOR BIT DATA and BINARY(n), but I'm unable to locate where it was. Any pointers?

I'm asking because I have loads of columns defined as CHAR(16) FOR BIT DATA from before BINARY(16) existed, and thinking about gradually migrate them to BINARY(16). I'm curious whether there are any circomstances where migrating one side of a f.k. relationship before the other will cause problems.


1 Answer 1


The main difference I believe is described at the Casting between data types link (see Table 1). For example, you can't cast BINARY data to/from many data types which it's possible to cast CHAR FOR BIT DATA to/from. So, it's more an application part problem, and one should check if their apps use such a casting or not.
That is, if you, say, store UUIDs as the result of the GENERATE_QNIQUE () function returning CHAR (13) FOR BIT DATA and use these values as an argument to the TIMESTAMP function, then you have to rewrite you code from TIMESTAMP (MY_BIT_COL) to TIMESTAMP (MY_BIT_COL :: CHAR (13) FOR BIT DATA).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.