Home » RDBMS Server » Server Administration » Help needed in Scheduling a parameterized procedure
Help needed in Scheduling a parameterized procedure [message #181339] Sat, 08 July 2006 17:34 Go to next message
grk28
Messages: 38
Registered: June 2006
Member
Hi Frnds,

I am facing a problem in scheduling jobs which is as follows:

I'm having a procedure which is having a date parameter,i want this procedure to be executed everyday at midnight.

i am trying the following but it is failing

HERE IS THE SAMPLE PROCEDURE I AM USING
/* Formatted on 2006/07/09 04:01 (Formatter Plus v4.8.7) */
CREATE OR REPLACE PROCEDURE insert_into_a (p_date VARCHAR2)
AS
BEGIN
INSERT INTO a
VALUES (TO_DATE(p_date,'MM/DD/YYYY'));

COMMIT;
END insert_into_a;
/

DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X
,what => 'INSERT_INTO_A('''07/09/2006'');'
,next_date => to_date('07/10/2006 03:21:00','dd/mm/yyyy hh24:mi:ss')
,interval => 'sysdate+1'
,no_parse => TRUE
);
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
END;
/

Can we put parameterized procedures in the job ??

If yes please give me an example.

Thanks in Advance,
RK.
Re: Help needed in Scheduling a parameterized procedure [message #181344 is a reply to message #181339] Sat, 08 July 2006 17:51 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Can we put parameterized procedures in the job ??
AFAIK, no, but you could easily create a "parameter table" & have the job read from it.
Previous Topic: Oracle names server
Next Topic: Oracle DB 10g XE
Goto Forum:
  


Current Time: Fri Sep 27 00:17:20 CDT 2024