Table changes by timestamp
755501Feb 11 2013 — edited Feb 15 2013I have a table that has a TIMESTAMP column that stores the last time the record was changed. I have to create a dbms_scheduler job (repeats at on 15 min interval) that will give me a list of all the table changes that happened during the timeframe. So I created a job that calls a stored procedure and executes every 15 minutes:
table:
emp
last_name varchar2,
...
last_change_date timestamp
job:
dbms_scheduler.create_job
(job_name => 'CHECK_TABLE_DATA_JOB',
job_type => 'PLSQL_BLOCK',
job_action =>
'begin
CHECK_TABLE_DATA;
end;',
repeat_interval => 'FREQ=MINUTELY; INTERVAL=15'
enabled=>true,
auto_drop=>false);
I'm a little unsure of the best way to query the changes in my procedure. I need to make sure that I catch all changes only 1 time, so I need to be precise on querying the 'last_change_date' timestamp column with time when job runs. Any ideas?