Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

execute scheduler jobs from package procedure and passing arguments

BufossNov 6 2018 — edited Nov 6 2018

Hi all,

I have two procedures in a package and I would like to execute them on parallel

as they insert data in different tables.

My package is as below :

CREATE OR REPLACE PACKAGE BODY name_pkg AS

-- --------------------------------------

PROCEDURE myproc1 (P_YEAR_MONTH IN VARCHAR2)

IS

BEGIN

  -- ...........

  -- ............

  COMMIT;

END myproc;

-- --------------------------------------

PROCEDURE myproc2 (P_YEAR_MONTH IN VARCHAR2)

IS

BEGIN

  -- ...........

  -- ............

  COMMIT;

END myproc;

-- --------------------------------------

PROCEDURE START_PROC (P_YEAR_MONTH IN VARCHAR2)

IS

BEGIN

  myproc1(P_YEAR_MONTH);

  myproc2(P_YEAR_MONTH);

END;

-- --------------------------------------

END name_pkg;

/

How can I create two schedulers and execute them only through name_pkg.START_PROC procedure ?

For example the 201801 I want to be variable and to be assigned from package

BEGIN

  DBMS_SCHEDULER.create_job (

    job_name        => 'proc1',

    job_type        => 'PLSQL_BLOCK',

    job_action      => 'BEGIN name_pkg.proc1(''201801''); END;',

    enabled         => TRUE);

END;

I am using 11g version.

Thanks in advance

This post has been answered by GregV on Nov 6 2018
Jump to Answer
Comments
Post Details
Added on Nov 6 2018
10 comments
163 views