G-2310: Avoid using CHAR data type.
Major
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)
CREATE OR REPLACE PACKAGE types_up
IS
SUBTYPE description_type IS CHAR(200);
END types_up;
/
Example (good)
CREATE OR REPLACE PACKAGE types_up
IS
SUBTYPE description_type IS VARCHAR2(200 CHAR);
END types_up;
/