1 Reply Latest reply on Mar 26, 2008 1:22 PM by 559730

    Cannot set job argument

    559730
      Hello all,

      I try to set an argument to a job which is a stored procedure, but the DBMS_SCHEDULER throws an error.
      CREATE OR REPLACE PROCEDURE my_proc (arg1 NUMBER) AS BEGIN NULL; END;
      BEGIN
          DBMS_SCHEDULER.create_job (
              job_name   => 'my_job',
              job_type   => 'STORED_PROCEDURE',
              job_action => 'my_proc');
      
          DBMS_SCHEDULER.set_job_argument_value (
              job_name              => 'my_job',
             argument_position     => 1,
             argument_value        => '1');
      
          DBMS_SCHEDULER.enable ('my_job');
      END;
      /
      ORA-27465: invalid value 1 for attribute ARGUMENT_POSITION
      ORA-06512: at "SYS.DBMS_ISCHED", line 207
      ORA-06512: at "SYS.DBMS_SCHEDULER", line 584
      ORA-06512: at line 7
      Oracle Database 10g Release 10.2.0.1.0 - 64bit Production
      PL/SQL Release 10.2.0.1.0 - Production
      CORE    10.2.0.1.0      Production
      TNS for Linux: Version 10.2.0.1.0 - Production
      NLSRTL Version 10.2.0.1.0 - Production
      Where am I wrong? The Oracle docs say that should work.

      Thank you in advance!

      Greetings,
      Mitko