Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL timing problem
Jun wrote:
> Hi guys,
>
> I want to get the elapsed time during the loop, once it is added
> up to 4 seconds I will exit the loop and give a timeout error.
> I am using mod(DBMS_UTILITY.get_time,100), but it seems that it
> was set to 0
> once it gets 100(which is 1 second). I want accumulative time(default
> is 0) that is spend during
> the loop. is there any nice idea about this?
>
>
> Thanks so much for any help:)
Something like this would work:
SQL> l
1 declare
2 v_start_time integer default 0;
3 begin
4 v_start_time := dbms_utility.get_time;
5 loop
6 if dbms_utility.get_time - v_start_time > 400 then 7 exit; 8 end if;
Elapsed: 00:00:04.01 Received on Tue Nov 28 2006 - 09:48:35 CST
![]() |
![]() |