SSC-EWI-OR0036

Types resolution issues, the arithmetic operation may not behave correctly between string and date.

Severity

Low

Description

This issue happens when an arithmetic operation may not behave correctly between two certain data types.

Example Code

Input Code:

IN -> Oracle_01.sql
SELECT
    SYSDATE,
    SYSDATE + '1',
    SYSDATE + 'A'
from
    dual;

Output Code:

OUT -> Oracle_01.sql
SELECT
    CURRENT_TIMESTAMP(),
    !!!RESOLVE EWI!!! /*** SSC-EWI-OR0036 - TYPES RESOLUTION ISSUES, ARITHMETIC OPERATION '+' MAY NOT BEHAVE CORRECTLY BETWEEN Date AND String ***/!!!
    CURRENT_TIMESTAMP() + '1',
    !!!RESOLVE EWI!!! /*** SSC-EWI-OR0036 - TYPES RESOLUTION ISSUES, ARITHMETIC OPERATION '+' MAY NOT BEHAVE CORRECTLY BETWEEN Date AND String ***/!!!
    CURRENT_TIMESTAMP() + 'A'
from
    dual;

Note that the operation between a String and Date may not behave correctly.

Recommendations

Last updated