Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Simple Use of dbms_scheduler

Re: Simple Use of dbms_scheduler

From: Anurag Varma <avoracle_at_gmail.com>
Date: 21 Feb 2007 15:21:06 -0800
Message-ID: <1172100066.073274.312370@t69g2000cwt.googlegroups.com>


On Feb 21, 6:14 pm, "Anurag Varma" <avora..._at_gmail.com> wrote:
> On Feb 21, 12:57 pm, "Ed" <e..._at_mail.com> wrote:
>
>
>
> > I just want a stored proc process to run in a separate session, immediately
> > no scheduling
>
> > I could use dbms_job to spawn it.
>
> > How do I do it with dbms_scheduler ?
> > How do I spawn "test" ?
>
> > CREATE OR REPLACE PACKAGE BODY testpkg IS
>
> > PROCEDURE test(p_alpha IN NUMBER DEFAULT 4321) IS
> > BEGIN
> > null;
> > END;
>
> > END;
>
> > thanks
> > 10gr2
>
> I ain't no dbms_scheduler expert .. but here is what
> I think is equivalent (hopefully the values/arguments are self
> explanatory):
> 10GR2> begin
> 2 DBMS_SCHEDULER.CREATE_JOB(
> 3 job_name => 'ONE_TIME_JOB',
> 4 job_type => 'PLSQL_BLOCK',
> 5 job_action => 'begin testjob_proc; end;',
> 6 start_date => systimestamp,
> 7 enabled => true,
> 8 auto_drop => true);
> 9 end;
> 10 /
>
> PL/SQL procedure successfully completed.
>
> 10GR2> select * from testjob;
>
> A
> ------------------------
> 21-FEB-07 17:47:04
>
> Anurag

BTW: job_name uniquely identifies the job... and has to be unique in sql namespace.
You might want to use dbms_scheduler.generate_job_name as the job_name. It will generate a unique job_name.

Anurag Received on Wed Feb 21 2007 - 17:21:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US