G-2320
🆓Error
Never use VARCHAR data type.
Reason
Do not use the varchar
data type. Use the varchar2
data type instead. Although the varchar
data type is currently synonymous with varchar2
, the varchar
data type is scheduled to be redefined as a separate data type used for variable-length character strings compared with different comparison semantics.
Example
Non-Compliant Example
create or replace package types_up is subtype description_type is varchar(200); end types_up; /
Issues
Line | Column | Message |
---|---|---|
2 | 32 |
★★★★★
Compliant Solution -
create or replace package types_up is subtype description_type is varchar2(200 char); end types_up; /
References
- same as Trivadis G-2320
- same as plsql:VarcharUsageCheck