Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: dbms_job
On Mon, 05 May 1997 14:01:31 -0500, Tom Hanstra <hanstra.1_at_nd.edu> wrote:
>I'm trying to use the dbms_job package without much luck. Does
>anyone have an example or two of how this package works?
>
>Thanks in advance. Please email replies.
>
>Tom Hanstra
>------------------------------------------------------------------------
>Thomas A. Hanstra Phone: (219)631-4686
>Office of Information Technologies Email: hanstra_at_puck.cc.nd.edu
>University of Notre Dame
>Room G011 Computing Center/Math Building
>Notre Dame, IN 46556
>------------------------------------------------------------------------
Make sure the job parameters are set in your init.ora, for example:
NAME TYPE VALUE ----------------------------------- ------- ------------------------------ job_queue_interval integer 60 job_queue_keep_connections boolean FALSE job_queue_processes integer 1
And then, its as easy as:
declare
l_job number;
begin
dbms_job.submit( l_job, 'SomeProcedure;' );
end;
/
NOTE the semicolon. Dbms_job simply takes the 'WHAT' portion of its input, glues a begin on fron and an end; on the end and executes it. So the above would become:
begin
SomeProcedure;
end;
Without my semi-colon, it would not work. Note that you can pass in any statement, does not have to be a procedure. For example:
dbms_job.submit( l_job, 'insert into T values (1);' );
would be valid as well...
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |