I am performing date / time manipulation in pl/sql. The following SQL runs fine.
select sysdate - interval '60' minute from dual;
the result = 6/24/2003 8:39:34 AM
But when I put it in pl/sql I get the following error:
create or replace function time_diff return date is
v_result date;
begin
select sysdate - interval '60' minute into v_result from dual;
return(v_result);
end time_diff;
Compilation errors for FUNCTION XOSOR.TIME_DIFF
Error: PLS-00201: identifier 'NUMTODSINTERVAL' must be declared
Line: 4
Text: select sysdate - interval '60' minute into v_result from dual;
Error: PL/SQL: SQL Statement ignored
Line: 4
Text: select sysdate - interval '60' minute into v_result from dual;
select sysdate - interval '60' minute from dual;
the result = 6/24/2003 8:39:34 AM
But when I put it in pl/sql I get the following error:
create or replace function time_diff return date is
v_result date;
begin
select sysdate - interval '60' minute into v_result from dual;
return(v_result);
end time_diff;
Compilation errors for FUNCTION XOSOR.TIME_DIFF
Error: PLS-00201: identifier 'NUMTODSINTERVAL' must be declared
Line: 4
Text: select sysdate - interval '60' minute into v_result from dual;
Error: PL/SQL: SQL Statement ignored
Line: 4
Text: select sysdate - interval '60' minute into v_result from dual;