G-2330
🆓Error
Never use zero-length strings to substitute NULL.
Reason
Today zero-length strings and null
are currently handled identical by the Oracle Database. There is no guarantee that this will still be the case in future releases, therefore if you mean null
use null
.
Example
Non-Compliant Example
create or replace package body constants_up is function null_string return varchar2 deterministic is begin return ''; end null_string; end constants_up; /
Issues
Line | Column | Message |
---|---|---|
6 | 14 |
★★★★★
Compliant Solution -
create or replace package body constants_up is function empty_string return varchar2 deterministic is begin return null; end empty_string; end constants_up; /
References
- same as Trivadis G-2330
- same as plsqlopen:EmptyStringAssignment