Home » SQL & PL/SQL » SQL & PL/SQL » how to create a job which runs automatically for every 4 minutes
how to create a job which runs automatically for every 4 minutes [message #39146] Thu, 20 June 2002 09:20 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,
I want to create a job which will run for every 4 minutes.

Can anyone give me the code for the job creation for the above.

Any help is appreciated..
Re: how to create a job which runs automatically for every 4 minutes [message #39148 is a reply to message #39146] Thu, 20 June 2002 09:57 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
sql>var v_job integer
sql>exec dbms_job.submit(:v_job, 'procname;', sysdate, 'sysdate + (4/(60*24))');

PL/SQL procedure successfully completed.

sql>commit;

Commit complete.
Re: how to create a job which runs automatically for every 4 minutes [message #39153 is a reply to message #39146] Fri, 21 June 2002 02:41 Go to previous messageGo to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
The job does not run.
One more thing,i see the jobs in the dba_jobs table,but now how to remove the jobs from that table.
how do i check whether the job is running or not

declare
TEST_JOB pls_integer :=10;
BEGIN
dbms_job.submit( job => TEST_JOB,
what => 'jobtest;',
next_date => sysdate,
interval => 'sysdate + (5/(24*60))');

--dbms_job.submit(:jb,'BEGIN YOUR_PROC;END;',SYSDATE,'SYSDATE+(4/(24*60))');
--COMMIT;
END;

end;

CREATE OR REPLACE PROCEDURE jobtest as
begin
update test1 set col1= col1 + 1;
commit;
end;
Re: how to create a job which runs automatically for every 4 minutes [message #39156 is a reply to message #39153] Fri, 21 June 2002 08:42 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
To see if the job is running, look in dba_jobs at the last_date, broken, and failures columns.

To remove the job, get the job number from the view and:

exec dbms_job.remove(:job);


and then commit.
Previous Topic: Re: How do I set the value of a Composite Foreign Key ?
Next Topic: change inittrans value for a table
Goto Forum:
  


Current Time: Thu Apr 25 15:52:47 CDT 2024