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!

ORA-00932: inconsistent datatypes: expected INTERVAL DAY TO SECOND got NUMBER

ABU JAMANMay 2 2018 — edited May 2 2018

Hi all,

Good morning, We are in 12.1.0.2 db. I am trying to find all records of a particular job that exceed above 10 min duration. I am getting below error. Please help...

Wrote file afiedt.buf

  1  select UPPER(client_name) "NAME",job_status "STATUS", to_char(job_start_time,'MM/DD/YY HH24:MI')"START",SUBSTR(job_duration,6,13) "DURATION"

  2  from dba_autotask_job_history

  3  where job_start_time > sysdate -45

  4  and client_name in ('auto optimizer stats collection')

  5  and job_duration > 10

  6* order by job_start_time

and job_duration > 10

                 *

ERROR at line 5:

ORA-00932: inconsistent datatypes: expected INTERVAL DAY TO SECOND got NUMBER

Name                                  Null?Type

----------------------------------------- -------- ----------------------------

CLIENT_NAME                                    VARCHAR2(64)
WINDOW_NAME                                    VARCHAR2(261)
WINDOW_START_TIME                              TIMESTAMP(6) WITH TIME ZONE
WINDOW_DURATION                                INTERVAL DAY(9) TO SECOND(6)

JOB_NAME                                       VARCHAR2(261)
JOB_STATUS                                     VARCHAR2(30)
JOB_START_TIME                                 TIMESTAMP(6) WITH TIME ZONE
JOB_DURATION                                   INTERVAL DAY(3) TO SECOND(0)

JOB_ERROR                                      NUMBER
JOB_INFO                                       VARCHAR2(4000)
This post has been answered by Frank Kulash on May 2 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 30 2018
Added on May 2 2018
15 comments
8,238 views