This discussion is archived
5 Replies Latest reply: Oct 2, 2012 3:29 AM by Brian Maher RSS

Create and Schedule Job - Problem

962810 Newbie
Currently Being Moderated
hi everyone,

I'm trying to write an Job which I would like to schedule. Function of this Job is to delete all entries older than 1 Month in the table "tabelle1". As I understand, you can put in job_action the procedure statement.

BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'delete_all_entries',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN DELETE FROM tabelle1 WHERE last_date < (SYSDATE - INTERVAL '1' MONTH) AND (status = 'processed'); END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'FREQ=WEEKLY;BYDAY=SAT;BYHOUR=10;BYMINUTE=00',
end_date => NULL,
enabled => TRUE,
comments => 'Job defined entirely by the CREATE JOB procedure.');

END;

I get the following error message:

--------------------------------------------------------------------------------------------------------------
ORA-06550: Zeile 5, Spalte 118:
PLS-00103: Encountered the symbol "1" when expecting one of the following:

) , * & = - + < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
06550. 00000 - "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:
-------------------------------------------------------------------------------------------------------------

What am I doing wrong?.
Thx in advance!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points