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!

DBMS_SCHEDULER issue

Boobal GanesanJan 24 2018 — edited Feb 1 2018

Hello Mates,

I've been trying to call a python script through a windows batch file (execute.bat). The script is shown below,

C:\AppData\Local\Continuum\anaconda2\python.exe C:\test.py

This batch works perfectly fine when I try run it manually but when I put it under a scheduler, it fails. The scheduler code is shown below,

BEGIN

    dbms_scheduler.create_job(

        job_name              => 'send_mail',

        job_type              => 'EXECUTABLE',

        job_action            => 'C:\WINDOWS\system32\cmd.exe',

        job_class             => 'DEFAULT_JOB_CLASS',

        comments              => 'Job to call batch script on Windows',

        auto_drop             => false,

        number_of_arguments   => 2,

        enabled               => false

    );

  dbms_scheduler.set_job_argument_value(

        job_name            => 'send_mail',

        argument_position   => 1,

        argument_value      => '/c'

    );

dbms_scheduler.set_job_argument_value(

        job_name            => 'send_mail',

        argument_position   => 2,

        argument_value      => 'C:\Users\63619\Desktop\execute.bat'

    );

    dbms_scheduler.enable('send_mail');

    dbms_scheduler.run_job('send_mail');

END;

/

Thank you,

B

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2018
Added on Jan 24 2018
11 comments
1,262 views