The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.
Thanks for the question, Ernesto.
Asked: December 13, 2017 - 3:09 pm UTC
Last updated: December 15, 2017 - 6:46 am UTC
Version: 11.2
Viewed 1000+ times
create or replace function next_day_start ( p_date in date ) return date authid definer is l_date date not null:=p_date; begin return 1 + trunc(l_date); end;
create or replace package pkg as subtype date_nn is date not null; end; / create or replace function next_day_start ( p_date in pkg.date_nn ) return date authid definer is begin return 1 + trunc(p_date); end; / select next_day_start(null) from dual; SQL Error: ORA-06553: PLS-567: cannot pass NULL to a NOT NULL constrained formal parameter
Ernesto, December 14, 2017 - 3:49 pm UTC
create or replace function next_day_start ( p_date in date ) return date authid definer is -- same plw warning l_date date not null:=p_date; -- no plw warning -- l_date date:=p_date; begin l_date:= trunc(l_date); return 1 + trunc(l_date); end;
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library