Skip to content

G-2320: Never use VARCHAR data type.

Major

Portability

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 (bad)

1
2
3
4
create or replace package types_up is
   subtype description_type is varchar(200);
end types_up;
/

Example (good)

1
2
3
4
create or replace package types_up is
   subtype description_type is varchar2(200 char);
end types_up;
/