Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9035805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:50:35+00:00 2026-06-16T08:50:35+00:00

I have a table in which i have some data related to oracle job

  • 0

I have a table in which i have some data related to oracle job which executes some procedures.Here is the query and data format.

SELECT SRLNUM, TABLE_NAME, PURPOSE, LAST_UPDATE, DUR,
TO_DATE (TO_CHAR (LAST_UPDATE, 'MM/DD/YYYY HH:MI:SS AM'),'MM/DD/YYYY HH:MI:SS AM')+ DUR / (24 * 60) RUNTIME
FROM V_DASHJOBS

Here is the data of table which have job details

enter image description here

Question is that is there any way that i can detect using query that job has not still run on its RUNTIME and also if job has not run on its RUNTIME then flag 0 should return and if has run then 1 should return.

I am calculating RUNTIME by adding DUR to last_update and also i want to give a relax of 30 minutes to job that job can be run 30 minute late from actual runtime

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:50:36+00:00Added an answer on June 16, 2026 at 8:50 am

    We can do arithmetic with Oracle’s DATE datatype, so your calculation of RUNTIME is too complex.

    This query takes your query and adds a CASE statement to compare the derived RUNTIME with the current datetime. If I have properly understood your requirement, this will allow you to determine whether a job has run as scheduled.

    with data as (
        SELECT SRLNUM
              , TABLE_NAME
              , PURPOSE
              , LAST_UPDATE
              , DUR
              , LAST_UPDATE+ (DUR / (24 * 60)) RUNTIME
        FROM V_DASHJOBS )
    select data.*
           , case when sysdate < data.runtime then 1 else 0 end as haz_run
           , case when sysdate < data.runtime + (1/48) then 1 else 0 end as haz_run_with_slack
    from data
    /
    

    The second CASE() statements adds an extra half-hour to the derived runtime, to allow for your supplementary requirement, “that job can be run 30 minute late from actual runtime”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given I have table with some data... I have a query which is used
Ok, I have a table which contains multiple rows. Each row contains some data
I have an access table which has some cells as blank ( no data
I have Access table with fields, in which there is some data and path
I have a data table which already has some values, plus it is getting
I do have a table which contain some data in it and a form
I have a SQL table in which some columns, when viewed in SQL Server
I have a table which already contains an index in MySQL. I added some
I have a table on which I want to perform some operations every hour.
I have a table conditions, which defines some conditions. I have another table called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.