Home » SQL & PL/SQL » SQL & PL/SQL » Schedule a Procedure with Input Parameters (Oracle PL/SQL)
Schedule a Procedure with Input Parameters [message #621488] Wed, 13 August 2014 14:03 Go to next message
praveenramaswamy
Messages: 34
Registered: December 2013
Member
Dear Experts

Need your guidance. I wrote a Stored Procedure that has got 3 Input Parameters as below, which create a TEXT File.

Company Code = C and F
Month = Current Month in Number
Year = Current Year

While i run this procedure manually, I pass the input parameter accordingly and it works. No issues here.

I need to schedule the job to run 15th of each month. While it runs on the 15th, how can i pass the input parameter automatically.

Please assist

Regards
Re: Schedule a Procedure with Input Parameters [message #621490 is a reply to message #621488] Wed, 13 August 2014 14:12 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
how to decide/determine what is correct/desired Company Code?

SQL> select to_char(sysdate,'MM'), to_char(sysdate,'YYYY')  from dual;

TO,TO_C
--,----
08,2014

Re: Schedule a Procedure with Input Parameters [message #621491 is a reply to message #621490] Wed, 13 August 2014 14:15 Go to previous messageGo to next message
praveenramaswamy
Messages: 34
Registered: December 2013
Member
BlackSwan wrote on Wed, 13 August 2014 14:12
how to decide/determine what is correct/desired Company Code?

SQL> select to_char(sysdate,'MM'), to_char(sysdate,'YYYY')  from dual;

TO,TO_C
--,----
08,2014



The Procedure ideally will create 2 text files.
First Text File with Input Parameters: Company Code = C, Month = 08, Year = 2014
Second Text File with Input Parameters: Company Code = F, Month = 08, Year = 2014
Re: Schedule a Procedure with Input Parameters [message #621492 is a reply to message #621491] Wed, 13 August 2014 14:19 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
have two separate jobs; one where Company Code is hard coded to be "C" & the other to be "F"
or don't bother with passing in the Company Code & just hardcode in the procedure to use each letter once.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and read http://www.orafaq.com/forum/t/174502/
Previous Topic: USE IS NULL AND NOT NULL IN A CHECK CONSTRAINT
Next Topic: Index and Partitions
Goto Forum:
  


Current Time: Thu Mar 28 12:24:00 CDT 2024