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!

Unable to run the batch file from DBMS_SCHEDULER.create_job

Fahed AkhtarJan 29 2026

I need to call the batch file and below are my codes.

BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'RUN_FATOORA_BAT',
job_type => 'EXECUTABLE',
job_action => 'C:\Windows\System32\cmd.exe',
number_of_arguments => 3,
enabled => FALSE,
auto_drop => TRUE
);

DBMS_SCHEDULER.set_job_argument_value('RUN_FATOORA_BAT', 1, '/q');
DBMS_SCHEDULER.set_job_argument_value('RUN_FATOORA_BAT', 2, '/c');
DBMS_SCHEDULER.set_job_argument_value('RUN_FATOORA_BAT', 3, 'D:\zatca-einvoicing-sdk-Java-238-R3.4.5\Apps\fatoora.bat -sign -invoice D:\zatca-einvoicing-sdk-Java-238-R3.4.5\Apps\invoice.xml -signedInvoice D:\zatca-einvoicing-sdk-Java-238-R3.4.5\Apps\signed.xml');

DBMS_SCHEDULER.enable('RUN_FATOORA_BAT');
END;

SELECT log_date, status, additional_info
FROM all_scheduler_job_run_details
WHERE job_name = 'RUN_FATOORA_BAT'
ORDER BY log_date DESC;

When I query from above statement then below error is coming

STATUS=SUCCESS

ADDITIONAL INFO:STANDARD_ERROR="jq: error: Could not open file /global.json: No such file or directory"

Content of fatoora.batch is

@echo off

SET VAR=
FOR /F %%I IN ('jq .version %FATOORA_HOME%/global.json') DO set "VAR=%%I"

set "VAR=%VAR:~1,-1%"

if exist "%FATOORA_HOME%/zatca-einvoicing-sdk-%VAR%.jar" call java -Djdk.module.illegalAccess=deny -Dfile.encoding=UTF-8 -jar %FATOORA_HOME%/zatca-einvoicing-sdk-%VAR%.jar --globalVersion %VAR% %*

Note:global.json file is already availble in D:\zatca-einvoicing-sdk-Java-238-R3.4.5\Apps folder.

Tried with the shell command also but getting “Process err :/F was unexpected at this time.” error.

BEGIN
DBMS_OUTPUT.enable(1000000);
DBMS_JAVA.set_output(1000000);

host_command('D:\zatca-einvoicing-sdk-Java-238-R3.4.5\Apps\fatoora.bat -sign -invoice D:\zatca-einvoicing-sdk-Java-238-R3.4.5\Apps\invoice.xml -signedInvoice D:\zatca-einvoicing-sdk-Java-238-R3.4.5\Apps\signed.xml');

END;

Comments
Post Details
Added on Jan 29 2026
7 comments
193 views