G-2310: Avoid using CHAR data type.
Blocker
Reliability
Reason
char
is a fixed length data type, which should only be used when appropriate. char
columns/variables are always filled to its specified lengths; this may lead to unwanted side effects and undesired results.
Example (bad)
1 2 3 4 5 |
|
Unexpected trailing spaces can lead to wrong results.
1 2 3 4 5 6 7 8 9 |
|
1 2 3 |
|
Example (good)
1 2 3 4 5 |
|