PL/SQL (MOSC)

MOSC Banner

How to check date variable filled with null

edited Feb 22, 2019 1:38AM in PL/SQL (MOSC) 10 commentsAnswered ✓

Hello,

i do not understand why i cant check a variable of type date for null.

Tried "is null" and "nvl", both dont work.

Can someone explain why?

greets

create or replace function odbcread.dateadd_workdays (d in date, w in integer)return dateisdw date;begin    select datum    into dw    from (        select datum, rownum wd        from prod_erp_001.kalender        where datum >= d        and datum <= d + 14        and arbeitstag = 'J'        order by datum    )    where wd = w    ;        if dw is null then        dw := d + w;    end if;        dw := nvl(dw, sysdate);        return dw;end;/select odbcread.dateadd_workdays(sysdate, -8) from dual;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center