i want to validate date format in my procedure.
create or replace procedure sp_val_date(pi_id in number,pi_date in varchar2)
is
lv_date date;
begin
lv_date:=to_date(pi_date,'DD/MON/YYYY');
insert into DT_FRMT values(pi_id,lv_date);
DBMS_OUTPUT.PUT_LINE('Valid date');
exception when others then
dbms_output.put_line('Not a valid date');
end;
i want enter date in format 'DD/MM/YYYY' but when i entered as 'DD-MM-YYYY' ,my procedure did not throw error.