Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Delay or Wait function call in PL/SQL
Try
dbms_lock.sleep(5);
or use (taken from some Oracle docs):
function sleep( p_SleepSec in number default 60
, p_PipeName in varchar2 default null ) return number
v_StartTime number(30); v_EndTime number(30); v_PipeStatus integer; v_PipeName varchar2(128) := p_PipeName;begin
v_PipeName := concat(dbms_pipe.unique_session_name, 'LucentSleep');
end if;
v_StartTime := to_number( ((to_char(sysdate, 'J') - 1 ) * 86400) +
to_char(sysdate, 'SSSSS') );
to_char(sysdate, 'sssss') ); if ( v_PipeStatus = 1 ) then return(0); else return(p_SleepSec - (v_EndTime - v_StartTime));end if;
The latter has the capability to terminate the sleep by sending a message over the named pipe.
Arjan.
> Is there any way to call a delay or wait function call inside PL/SQL
>to make a procedure or function sleep await e.g. 5 sec before execute
>next statement.
Received on Wed Aug 12 1998 - 00:00:00 CDT
![]() |
![]() |