Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get the difference between start and end time of a job (within a batch)

450482May 6 2008 — edited May 12 2008
A batch may consist of a number of jobs running. So I have a batch
table and a jobs table as follows:
SQL> desc batch
 Name                                      Null?    Type
 ----------------------------------------- -------- ------------------
 BATCH_ID                                  NOT NULL NUMBER
 BATCH_LATEST_JOB_ID                         NOT NULL NUMBER
) <br/>

SQL> desc jobs
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 JOB_ID                                    NOT NULL NUMBER
 BATCH_ID                                           NUMBER
 <br/>
Now I also have a job_time table that gives me the start and end time for
the jobs.Here is the structure.
SQL> desc jobs_time
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 JOBS_LOAD_ID                              NOT NULL NUMBER
 START_TIME                                NOT NULL DATE
 JOB_ID                                    NOT NULL NUMBER
 END_TIME                                           DATE
 
I need the time diff between the
1st job (min jobsload id) of a particular batch
and the end_time (for BATCH_LATEST_JOB_ID). How can I do that?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2008
Added on May 6 2008
8 comments
640 views