I'm just a newbie in Oracle and can't seem to get this work to work: –
I want to delete the old lines from my database. And created a job as follows: –
CREATE OR REPLACE PROCEDURE delete_trips AS BEGIN DBMS_OUTPUT.PUT_LINE('Here'); DELETE FROM trip y where sysdate > y.arrival_date; END; / BEGIN DBMS_SCHEDULER.CREATE_JOB( job_name => 'delete_old_rows', job_type => 'PLSQL_BLOCK', job_action => 'EXECUTE delete_trips;', start_date => sysdate, repeat_interval => 'FREQ=SECONDLY', end_date => add_months(sysdate,12), auto_drop => FALSE, enabled => TRUE ); END; /
After running the above code, I can see that the work & # 39; delete_old_rows & # 39; is scheduled in DBA_SCHEDULER_JOBS, but neither the rows are deleted nor the output is produced in the terminal. I have tried to disconnect and reconnect, but no lines have been deleted and no output has been produced. And lines fulfilling the deletion condition exist. Please help. What am I missing?