Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL intervals
Could someone explain to me why the following creates an error? It only
happens if the interval is over 100, however I thought that seeing as I
declared days as day(9) this would be ok?
Could it be something to do with the return value of the function? AFAIK I cannot declare the return value to be:
return interval day(9) to second
or???????
here is the code:
declare
2 b interval day(9) to second(9);
3 function double_my_interval( a in interval day to second) return
interval day to second
4 is
5 begin
6 return a * 2;
7 end;
8 begin
9 b :=((sysdate - 100) - sysdate) day(9) to second(9);
10
11 dbms_output.put_line(b);
12 dbms_output.put_line(double_my_interval(b));
13 end;
14 /
declare
*
ERROR at line 1:
ORA-01873: the leading precision of the interval is too small
ORA-06512: at line 12
Received on Mon Oct 25 2004 - 09:31:04 CDT