divya.trehan573
divya.trehan573

Reputation: 564

How to call parameterized shell script via plsql

I have shell script :

#Note: If you see # in front of any line it means that it’s a comment line not the actual code
#** ********************************************************************
#
#** ********************************************************************
#Parameters from 1 to 4 i.e $1 $2 $3 $4 are standard parameters
# $1 : username/password of the database
# $2 : userid
# $3 : USERNAME
# $4 : Concurrent Request ID
config_id=$5
extract_id=$6
# exit 1 represents concurrent program status. 1 for error, 2 for warning 0 for success
echo “****************************************************************”

I have to call this host type program from a PLSQL procedure. Can this be done ?

Upvotes: 1

Views: 201

Answers (1)

David Aldridge
David Aldridge

Reputation: 52396

Yes, via DBMS_Scheduler.

  1. Create program, using DBMS_SCHEDULER.CREATE_PROGRAM
  2. Create a job referencing the program, using DBMS_SCHEDULER.CREATE_JOB
  3. Execute the job.

There's a walkthrough here: http://www.databasejournal.com/features/oracle/article.php/3365371/Executing-External-Programs-From-Within-Oracle.htm

And see the docs here https://docs.oracle.com/cd/B28359_01/server.111/b28310/schedadmin006.htm#ADMIN12062

Upvotes: 1

Related Questions