Difference between timestamps

Hi,
Please provide a solution for the below problem.
"If the difference between current system date(timestamp) and the most recent date available in a table(the table has timestamp as one of the column) is greater than 2 years,then the table should be displayed in the page".
Inshort, i need to calculate the difference in years(or in months) and need to compare the answer with 2 years
(or in 24 months).
Thanks in advance.

how can i calculate the difference between two dates final String DATE_FORMAT_NOW = "yyyy-MM-dd";
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
String f1 =  sdf.format(cal.getTime());
String f2 =  sdf.format(sampleDate);now f1 will be having system date for eg.,2009-09-10.
sampleDate is a variable which holds value like 2008-09-10.
How can i find the difference between the two?

Similar Messages

  • Difference between timestamp oracle datatype as unix timestamp

    Hi
    We are having a column in our table as create_ts which is the time, the row is updated. We are in need to get this time in Pro*c as unix timestamp type to find out the oldest row from a set of rows.
    I found that the following query works when I convert to date and find out the difference.
    select TO_NUMBER((TO_DATE (TO_CHAR (CREATE_TS, 'YYYY-MON-DD HH24:MI:SS'),'YYYY-MON-DD HH24:MI:SS') - to_date('01.01.1970 00:00:00','dd.mm.yyyy HH24:mi:ss')) * 24 * 60 * 60 - TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))*3600 ,9999999999) as timestamp from customer;
    However when I keep it as timestamp type I'm getting some error
    select TO_NUMBER((CREATE_TS - to_timestamp('01.01.1970 00:00:00','dd.mm.yyyy HH24:mi:ss'))* 24 * 60 * 60 *1000 - TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))*3600000 ,9999999999999) as timeints from customer;
    ERROR
    ORA-30081: invalid data type for datetime/interval arithmetic
    30081. 00000 - "invalid data type for datetime/interval arithmetic"
    FYI: since if I convert to date type, we're losing the microseconds, we had to find the difference using the timestamp type.
    thanks

    When you take a difference between two timestamps, You dont get a number(like substracting dates). You get a string that has number of days,hours,minutes and seconds.
    You can break the string though,
    SQL> SELECT SUBSTR(today,1,30) today,
      2         SUBSTR(tomorrow,1,30) tomorrow,
      3         SUBSTR((tomorrow-today), INSTR((tomorrow-today),' ')+7,2) "SS",
      4         SUBSTR((tomorrow-today), INSTR((tomorrow-today),' ')+4,2) "MI",
      5         SUBSTR((tomorrow-today), INSTR((tomorrow-today),' ')+1,2) "HH",
      6         TRUNC(TO_NUMBER(SUBSTR((tomorrow-today),1, INSTR(tomorrow-today,' ')))) "Days"
      7    FROM (SELECT TO_TIMESTAMP(SYSDATE) today,TO_TIMESTAMP(SYSDATE+1) tomorrow FROM dual);
    TODAY                          TOMORROW                       SS MI HH       Days
    10-MAR-11 12.00.00 AM          11-MAR-11 12.00.00 AM          00 00 00          1
    SQL>
    SQL> G.

  • Difference between timestamps and then an avg of all

    ok I have 3 columns
    ID, callstart, callend
    in the callsession table
    and I need to take the difference of the timestamps in callstart and callend in the form: 'mm/dd/yyyy hh:mi:ss AM' and at the bottom of the sheet I want to take an average and a total of all time differences.
    some of the calls are in PM so I don't know how I should proceed.
    please help if possible( i don't have permission to create views or tables...read-only access)

    Try:
    COMP AVG LABEL 'AVG Time' OF time_diff ON REPORT
    BREAK ON REPORT
    Select ID, callstart, callend, (callend-callstart) time_diff
      From callsession;

  • What is the difference between timestanp and vtimestamp?

    Some script uses variable "timestamp" , and some uses "vtimestamp".
    I can't understand exact difference between timestamp and vtimestamp,
    though I found description as follows.
    timestamp
    The current value of a nanosecond timestamp counter. This counter
    increments from an arbitrary point in the past and should only be
    used for relative computations.
    vtimestamp
    The current value of a nanosecond timestamp counter that is virtualized
    to the amount of time that the current thread has been running on a CPU,
    minus the time spent in DTrace predicates and actions. This counter
    increments from an arbitrary point in the past and should only be used
    for relative time computations.
    Would you explain the difference?
    Thank you.

    "timestamp" evaluates to the current value of a system-global 64-bit nanosecond counter, available (and documented) in gethrtime(3C) from C programs. Values of "timestamp" from different threads can be directly compared.
    "vtimestamp" is a 64-bit thread-local nanosecond counter which counts time the thread has spent on-CPU, excluding time spent processing dtrace probes and actions. (It is similar to gethrvtime(3C), but not identical to it -- gethrvtime(3C) includes dtrace processing time). The only operation on vtimestamp values which gives a meaningful result is subtracting two values from the same thread to get "time spent on-CPU" between two probe points for that thread.
    (at the moment, vtimestamp will include time spent doing high-level interrupt processing while the thread is on-CPU. In the future, that will probably be corrected.)

  • Need a sql query to get the difference between two timestamp in the format of hh:mm:ss.msec

    I have a database table where it keeps record of the transaction when it starts at StartTime and when it ends at EndTime. Both these entries are having the timestamp entries. Say for example, I have a tuple with Entries like 'Transaction A' starts at '2014-05-07
    20:55:03.170' and ends at '2014-05-08 08:56:03.170'. I need to find the difference between these two timestamps and my expected output is 12:01:00.000. Let me know how to achieve this ? 

    Hi,
    You can use below script which calculates difference as DD:HH:MM:SS. You can modify the same:
    DECLARE @startTime DATETIME
    DECLARE @endTime DATETIME
    SET @startTime = '2013-11-05 12:20:35'
    SET @endTime = '2013-11-10 01:22:30'
    SELECT [DD:HH:MM:SS] =
    CAST((DATEDIFF(HOUR, @startTime, @endTime) / 24) AS VARCHAR)
    + ':' +
    CAST((DATEDIFF(HOUR, @startTime, @endTime) % 24) AS VARCHAR)
    + ':' +
    CASE WHEN DATEPART(SECOND, @endTime) >= DATEPART(SECOND, @startTime)
    THEN CAST((DATEDIFF(MINUTE, @startTime, @endTime) % 60) AS VARCHAR)
    ELSE
    CAST((DATEDIFF(MINUTE, DATEADD(MINUTE, -1, @endTime), @endTime) % 60)
    AS VARCHAR)
    END
    + ':' + CAST((DATEDIFF(SECOND, @startTime, @endTime) % 60) AS VARCHAR),
    [StringFormat] =
    CAST((DATEDIFF(HOUR , @startTime, @endTime) / 24) AS VARCHAR) +
    ' Days ' +
    CAST((DATEDIFF(HOUR , @startTime, @endTime) % 24) AS VARCHAR) +
    ' Hours ' +
    CASE WHEN DATEPART(SECOND, @endTime) >= DATEPART(SECOND, @startTime)
    THEN CAST((DATEDIFF(MINUTE, @startTime, @endTime) % 60) AS VARCHAR)
    ELSE
    CAST((DATEDIFF(MINUTE, DATEADD(MINUTE, -1, @endTime), @endTime) % 60)
    AS VARCHAR)
    END +
    ' Minutes ' +
    CAST((DATEDIFF(SECOND, @startTime, @endTime) % 60) AS VARCHAR) +
    ' Seconds '
    Reference:
    http://sqlandme.com/2013/12/23/sql-server-calculating-elapsed-time-from-datetime/
    - Vishal
    SqlAndMe.com

  • Difference between systimestamp and a column of timestamp

    Hi ,
    I want to get the minutes difference between systimestamp and a column which has value of certain timestamp
    Table1
    InsertTmstmp --> 03-FEB-10 01.43.07.865272000 AM
    now how can I get the difference in minutes between systimestamp - InsertTmstmp ?
    I tried the following
    select EXTRACT(minute FROM systimestamp - InsertTmstmp ) from table1 where seq_id = '9';
    but this was not giving proper results .
    For example if InsertTmstmp --> 03-FEB-10 01.43.07.865272000 AM
    and systimestamp is 03-FEB-10 02.03.15.678084000 AM GMT-07:00. then the select query is returning 50.
    and when I query
    select systimestamp - InsertTmstmp from table1 ,, this is not returning any value . ( i saw in some sites this query returning values ).
    Thanks in advance

    May be like this?
    with t
    as
    select systimestamp - (systimestamp-1) dt from dual
    select dt,
           extract(day from dt)*24*60+extract(hour from dt)*60+extract(minute from dt)+extract(second from dt)/60 interval_in_min
      from t

  • Difference between two timestamp.

    Hi,
    I want to find difference between two timestamp in minutes.
    Actually i want to retrieve difference between current timestamp and the timestamp taken from the table
    select log_time from serv_info where server_id = 1;
    Can anyone tell me the query to find difference between two timestamps in minutes.
    -haifriends

    SQL> WITH serv_in AS
         (SELECT SYSTIMESTAMP - 1 / 4 log_time,
                 SYSTIMESTAMP now
            FROM DUAL)
    SELECT log_time,
           now,
             24 * 60 * EXTRACT (DAY FROM (now - log_time))
           + 60 * EXTRACT (HOUR FROM (now - log_time))
           + EXTRACT (MINUTE FROM (now - log_time))
           + 1 / 60 * EXTRACT (SECOND FROM (now - log_time)) diff_in_minutes
      FROM serv_in
    LOG_TIME  NOW                                 DIFF_IN_MINUTES
    01-MRZ-07 01-MAR-07 03.47.42.107462 PM +01:00      360,001791

  • Difference between 2 timestamp,not considering the weekends (SATURDAY,SUN)

    I use an Oracle XE and I have a table which has the following Timestamp columns
    A_Date Timestamp
    R_Date Timestamp
    Now in this query i need to be able to exclude the SAT/SUN and show the difference between these 2 timestamp dates.
    Could any one help on this?
    I use this query to find out the difference between the 2 dates (R_DATE - A_DATE),showing the DAYS:HOURS:MIN:SECS
    TRUNC (TO_NUMBER (SUBSTR ((R_DATE - A_DATE),
    1,
    INSTR (R_DATE - A_DATE, ' ')
    || ':'
    || SUBSTR ((R_DATE - A_DATE),
    INSTR ((R_DATE - A_DATE), ' ') + 1,
    2
    || ':'
    || SUBSTR ((R_DATE - A_DATE),
    INSTR ((R_DATE - A_DATE), ' ') + 4,
    2
    || ':'
    || SUBSTR ((R_DATE - A_DATE),
    INSTR ((R_DATE - A_DATE), ' ') + 7,
    2
    ) "TTR"
    Example : A_DATE := '11-Dec-2009 19:33:30 PM' ---> Friday
    R_DATE := '14-Dec-2009 07:32:38 AM' ---> Monday
    should not consider the SAT/SUN that comes between them.
    Thanks
    GAG

    SQL> create table t as (
      2  select to_timestamp('11-dec-2009 07:33:30 PM') rdate
      3  ,      to_timestamp('14-dec-2009 07:32:38 AM') adate
      4  from   dual
      5  );
    Table created.
    SQL> select rdate
      2  ,      adate
      3         /* do some final formatting */
      4  ,      to_number(substr(diff_incl_weekend, 1, instr( diff_incl_weekend, chr(32))))
      5         ||':'||
      6         substr(diff_incl_weekend, instr( diff_incl_weekend, chr(32))+1, 8) diff_incl_weekend
      7  ,      to_number(substr(diff_excl_weekend, 1, instr( diff_excl_weekend, chr(32))))
      8         ||':'||
      9         substr(diff_incl_weekend, instr( diff_excl_weekend, chr(32))+1, 8) diff_excl_weekend    
    10  from ( /* substract intervals */
    11         select to_char(rdate, 'dd-mon-yyyy hh:mi:ss AM') rdate
    12         ,      to_char(adate, 'dd-mon-yyyy hh:mi:ss AM') adate
    13         ,      trim('+'
    14                from
    15                numtodsinterval((to_date(to_char(adate, 'dd-mon-yyyy hh:mi:ss AM'), 'dd-mon-yyyy hh:mi:ss AM')
    16                                 -
    17                                 to_date(to_char(rdate, 'dd-mon-yyyy hh:mi:ss AM'), 'dd-mon-yyyy hh:mi:ss AM')
    18                                )
    19                               , 'day')
    20                    ) diff_incl_weekend
    21         ,      trim('+'
    22                from            
    23                numtodsinterval((to_date(to_char(adate, 'dd-mon-yyyy hh:mi:ss AM'), 'dd-mon-yyyy hh:mi:ss AM')
    24                                 -
    25                                 to_date(to_char(rdate, 'dd-mon-yyyy hh:mi:ss AM'), 'dd-mon-yyyy hh:mi:ss AM')
    26                                 -
    27                                 nof_satsuns.total
    28                                )
    29                               , 'day')
    30                    ) diff_excl_weekend
    31         from   t
    32         ,      /* calculate nof sats and suns*/
    33              ( select count(dy) total
    34                from ( select to_char(rdate+level-1, 'dy') dy
    35                       from   t
    36                       where  to_char(rdate+level-1, 'dy', 'nls_date_language=american') in ('sat','sun')
    37                       connect by level <= trunc(to_date(to_char(adate, 'dd-mon-yyyy hh:mi:ss AM'), 'dd-mon-yyyy hh:mi:ss AM'))
    38                                           -
    39                                           trunc(to_date(to_char(rdate, 'dd-mon-yyyy hh:mi:ss AM'), 'dd-mon-yyyy hh:mi:ss AM'))+1
    40                     )    
    41              ) nof_satsuns
    42      );
    RDATE                   ADATE                   DIFF_INCL_WEEKEND                                 DIFF_EXCL_WEEKEND
    11-dec-2009 07:33:30 PM 14-dec-2009 07:32:38 AM 2:11:59:08                                        0:11:59:08

  • Timestamp: difference between these two time ?

    hello all, how can I calculate the difference between these two time acquired as strings?
    Thanks
    Attachments:
    Difference.jpg ‏59 KB

    Hi duglia,
    one way:
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Difference between Data sources

    Hi Experts,
    Can u Pls explain what is the difference between the data sources
    0FI_AR_3 :  CUSTOMERS LINE ITEMS
    0FI_AR_4 :  CUSTOMERS LINE ITEMS WITH DELTA EXTRACTION.
    Actually i am here in the implementation project. for FI the above 2 data sources having the same fields and also suggest me which one is better to use.
    Regards
    sridhar

    0FI_AR_3 : CUSTOMERS LINE ITEMS : Old and is replaced by 0FI_AR_4.
    This datasource was linked to FI-GL datasource.FI-GL datasource had to be loaded first which would set the timestamp for 0fi_ar_3 and 0fi_ap_3.
    0FI_AR_4 : CUSTOMERS LINE ITEMS WITH DELTA EXTRACTION. : 0FI_AR_3 was replaced by 0FI_AR_4 which allows decoupling from FI-GL and the delta mechanism is independent of FI-GL.
    There a some help.sap.com on the above check on them.
    Hope this helps.

  • What are differences between the target tablespace and the source tablespac

    The IMPDP command create so manay errors. But the EXAMPLE tablespace is transported to the target database successfully. It seems that the transported tablespace is no difference with the source tablespace.
    Why create so many errors?
    How to avoid these errors?
    What are differences between the target tablespace and the source tablespace?
    Is this datapump action really successfull?
    Thw following is the log output:
    [oracle@hostp ~]$ impdp system/oracle dumpfile=user_dir:demo02.dmp tablespaces=example remap_tablespace=example:example
    Import: Release 10.2.0.1.0 - Production on Sunday, 28 September, 2008 18:08:31
    Copyright (c) 2003, 2005, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Master table "SYSTEM"."SYS_IMPORT_TABLESPACE_01" successfully loaded/unloaded
    Starting "SYSTEM"."SYS_IMPORT_TABLESPACE_01": system/******** dumpfile=user_dir:demo02.dmp tablespaces=example remap_tablespace=example:example
    Processing object type TABLE_EXPORT/TABLE/TABLE
    ORA-39117: Type needed to create table is not included in this operation. Failing sql is:
    CREATE TABLE "OE"."CUSTOMERS" ("CUSTOMER_ID" NUMBER(6,0), "CUST_FIRST_NAME" VARCHAR2(20) CONSTRAINT "CUST_FNAME_NN" NOT NULL ENABLE, "CUST_LAST_NAME" VARCHAR2(20) CONSTRAINT "CUST_LNAME_NN" NOT NULL ENABLE, "CUST_ADDRESS" "OE"."CUST_ADDRESS_TYP" , "PHONE_NUMBERS" "OE"."PHONE_LIST_TYP" , "NLS_LANGUAGE" VARCHAR2(3), "NLS_TERRITORY" VARCHAR2(30), "CREDIT_LIMIT" NUMBER(9,2), "CUST_EMAIL" VARCHAR2(30), "ACCOUNT_MGR_ID" NU
    ORA-39117: Type needed to create table is not included in this operation. Failing sql is:
    ORA-39117: Type needed to create table is not included in this operation. Failing sql is:
    CREATE TABLE "IX"."ORDERS_QUEUETABLE" ("Q_NAME" VARCHAR2(30), "MSGID" RAW(16), "CORRID" VARCHAR2(128), "PRIORITY" NUMBER, "STATE" NUMBER, "DELAY" TIMESTAMP (6), "EXPIRATION" NUMBER, "TIME_MANAGER_INFO" TIMESTAMP (6), "LOCAL_ORDER_NO" NUMBER, "CHAIN_NO" NUMBER, "CSCN" NUMBER, "DSCN" NUMBER, "ENQ_TIME" TIMESTAMP (6), "ENQ_UID" VARCHAR2(30), "ENQ_TID" VARCHAR2(30), "DEQ_TIME" TIMESTAMP (6), "DEQ_UID" VARCHAR2(30), "DEQ_
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    . . imported "SH"."CUSTOMERS" 9.850 MB 55500 rows
    . . imported "SH"."SUPPLEMENTARY_DEMOGRAPHICS" 695.9 KB 4500 rows
    . . imported "OE"."PRODUCT_DESCRIPTIONS" 2.379 MB 8640 rows
    . . imported "SH"."SALES":"SALES_Q4_2001" 2.257 MB 69749 rows
    . . imported "SH"."SALES":"SALES_Q1_1999" 2.070 MB 64186 rows
    . . imported "SH"."SALES":"SALES_Q3_2001" 2.129 MB 65769 rows
    . . imported "SH"."SALES":"SALES_Q1_2000" 2.011 MB 62197 rows
    . . imported "SH"."SALES":"SALES_Q1_2001" 1.964 MB 60608 rows
    . . imported "SH"."SALES":"SALES_Q2_2001" 2.050 MB 63292 rows
    . . imported "SH"."SALES":"SALES_Q3_1999" 2.166 MB 67138 rows
    Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'USER1' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."REGIONS" TO "USER1"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'EXAM_03' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."REGIONS" TO "EXAM_03"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'USER1' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."COUNTRIES" TO "USER1"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'EXAM_03' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."COUNTRIES" TO "EXAM_03"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'USER1' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."LOCATIONS" TO "USER1"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'EXAM_03' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."LOCATIONS" TO "EXAM_03"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'USER1' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."DEPARTMENTS" TO "USER1"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'EXAM_03' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."DEPARTMENTS" TO "EXAM_03"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'USER1' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."JOBS" TO "USER1"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'EXAM_03' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."JOBS" TO "EXAM_03"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'USER1' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."EMPLOYEES" TO "USER1"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'EXAM_03' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."EMPLOYEES" TO "EXAM_03"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'USER1' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."JOB_HISTORY" TO "USER1"
    ORA-39083: Object type OBJECT_GRANT failed to create with error:
    ORA-01917: user or role 'EXAM_03' does not exist
    Failing sql is:
    GRANT SELECT ON "HR"."JOB_HISTORY" TO "EXAM_03"
    ORA-39112: Dependent object type OBJECT_GRANT:"OE" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type OBJECT_GRANT:"OE" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
    ORA-39112: Dependent object type INDEX:"OE"."CUSTOMERS_PK" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type INDEX:"OE"."CUST_ACCOUNT_MANAGER_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type INDEX:"OE"."CUST_LNAME_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type INDEX:"OE"."CUST_EMAIL_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type INDEX:"PM"."PRINTMEDIA_PK" skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    ORA-39112: Dependent object type CONSTRAINT:"OE"."CUSTOMER_CREDIT_LIMIT_MAX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type CONSTRAINT:"OE"."CUSTOMER_ID_MIN" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type CONSTRAINT:"OE"."CUSTOMERS_PK" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type CONSTRAINT:"PM"."PRINTMEDIA__PK" skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
    ORA-39112: Dependent object type CONSTRAINT:"IX"."SYS_C005192" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUSTOMERS_PK" creation failed
    ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_ACCOUNT_MANAGER_IX" creation failed
    ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_LNAME_IX" creation failed
    ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_EMAIL_IX" creation failed
    ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"PM"."PRINTMEDIA_PK" creation failed
    Processing object type TABLE_EXPORT/TABLE/COMMENT
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
    ORA-39112: Dependent object type REF_CONSTRAINT:"OE"."CUSTOMERS_ACCOUNT_MANAGER_FK" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39083: Object type REF_CONSTRAINT failed to create with error:
    ORA-00942: table or view does not exist
    Failing sql is:
    ALTER TABLE "OE"."ORDERS" ADD CONSTRAINT "ORDERS_CUSTOMER_ID_FK" FOREIGN KEY ("CUSTOMER_ID") REFERENCES "OE"."CUSTOMERS" ("CUSTOMER_ID") ON DELETE SET NULL ENABLE
    ORA-39112: Dependent object type REF_CONSTRAINT:"PM"."PRINTMEDIA_FK" skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
    Processing object type TABLE_EXPORT/TABLE/TRIGGER
    ORA-39082: Object type TRIGGER:"HR"."SECURE_EMPLOYEES" created with compilation warnings
    ORA-39082: Object type TRIGGER:"HR"."SECURE_EMPLOYEES" created with compilation warnings
    ORA-39082: Object type TRIGGER:"HR"."UPDATE_JOB_HISTORY" created with compilation warnings
    ORA-39082: Object type TRIGGER:"HR"."UPDATE_JOB_HISTORY" created with compilation warnings
    Processing object type TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
    ORA-39112: Dependent object type INDEX:"OE"."CUST_UPPER_NAME_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
    ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_UPPER_NAME_IX" creation failed
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
    ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
    ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
    ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    Processing object type TABLE_EXPORT/TABLE/INDEX/DOMAIN_INDEX/INDEX
    Processing object type TABLE_EXPORT/TABLE/POST_INSTANCE/PROCACT_INSTANCE
    ORA-39112: Dependent object type PROCACT_INSTANCE skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    ORA-39083: Object type PROCACT_INSTANCE failed to create with error:
    ORA-01403: no data found
    ORA-01403: no data found
    Failing sql is:
    BEGIN
    SYS.DBMS_AQ_IMP_INTERNAL.IMPORT_SIGNATURE_TABLE('AQ$_ORDERS_QUEUETABLE_G');COMMIT; END;
    Processing object type TABLE_EXPORT/TABLE/POST_INSTANCE/PROCDEPOBJ
    ORA-39112: Dependent object type PROCDEPOBJ:"IX"."AQ$_ORDERS_QUEUETABLE_V" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    ORA-39112: Dependent object type PROCDEPOBJ:"IX"."ORDERS_QUEUE_N" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    ORA-39112: Dependent object type PROCDEPOBJ:"IX"."ORDERS_QUEUE_R" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    ORA-39112: Dependent object type PROCDEPOBJ:"IX"."AQ$_ORDERS_QUEUETABLE_E" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    ORA-39112: Dependent object type PROCDEPOBJ:"IX"."ORDERS_QUEUE" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
    Job "SYSTEM"."SYS_IMPORT_TABLESPACE_01" completed with 63 error(s) at 18:09:14

    Short of trying to then reverse-engineer the objects that are in the dump file (I believe Data Pump export files contain some XML representations of DDL in addition to various binary bits, making it potentially possible to try to scan the dump file for the object definitions), I would tend to assume that the export didn't include those type definitions.
    Since it looks like you're trying to set up the sample schemas, is there a reason that you wouldn't just run the sample schema setup scripts on the destination database? Why are you using Data Pump in the first place?
    Justin

  • Difference between 2 Dates

    hi..Experts
    Req: In OBIEE,Difference between Start date and end date. Result should be in hh:mm:ss fromat
    I Tried with
    TIMESTAMPDIFF(SQL_TSI_SECOND, " Closed Date", "Scheduled Start Date")
    it gives me No.of Seconds.
    in Data format tab, custom= [FMT:Timestamp] then i am getting in hh:mm:ss tt fromat and the difference is incorrect
    i need format in hh:mm:ss
    Please give suggession......

    Hi User,
    Try this one
    Cast(TimeStampDiff(SQL_TSI_MINUTE,LAST_UPD,CUR RENT_TIME STAMP(0))/1440 as VARCHAR(10)) || ':' ||
    Cast(Mod(TimeStampDiff(SQL_TSI_MINUTE,LAST_UPD ,CURRENT_ TIMESTAMP(0))/60,60) as VARCHAR(2)) || ':' ||
    Cast(Mod(TimeStampDiff(SQL_TSI_MINUTE,LAST_UPD ,CURRENT_ TIMESTAMP(0)),60) as VARCHAR(2))
    Please note that the output of the Desired Format will be in VARCHAR.
    Thanks
    Don

  • Difference between date in 'HH:MI:SS.FF' format

    Hi All,
    I am on Oracle 10G.
    I have small doubt about How to Calculate the Difference between two date in formate 'HH:MI:SS.FF'?
    Sample data
    to_date('14-Aug-2007 11:07:42','DD-Mon-YYYY HH24:MI:SS.FF')
    to_date( '14-Aug-2007 10:02:30','DD-Mon-YYYY HH24:MI:SS.FF')
    Thanks
    Vivek

    Firstly, you cannot specify fractional seconds for the DATE type so the '.FF' format model element is illegal for this datatype.
    If you're using DATE you can do something like this:
      1  select to_char(hours, 'fm00')||':'||
      2  to_char(trunc(minutes), 'fm00')||':'||
      3  to_char(round((minutes - trunc(minutes))*60), 'fm00') as formatted
      4  from (
      5     select trunc(hours) as hours
      6     , (hours - trunc(hours))*60 as minutes
      7     from (
      8        select (
      9          to_date('14-AUG-2007 11:07:42','DD-MON-YYYY HH24:MI:SS')
    10        - to_date('14-AUG-2007 10:02:30','DD-MON-YYYY HH24:MI:SS')
    11        )*24 as hours
    12        from dual
    13     )
    14* )
    SQL> /
    FORMATTED
    01:05:12Might be easier to use INTERVALs and TIMESTAMPs though. Unfortunately there's no TO_CHAR for INTERVALS so you need to do something like this:
      1  select
      2    to_char(extract(hour from diff), 'fm00')||':'||
      3    to_char(extract(minute from diff), 'fm00')||':'||
      4    to_char(extract(second from diff), 'fm00') as formatted
      5  from (
      6     select
      7       to_timestamp('14-AUG-2007 11:07:42','DD-MON-YYYY HH24:MI:SS.FF')
      8     - to_timestamp('14-AUG-2007 10:02:30','DD-MON-YYYY HH24:MI:SS.FF')
      9     as diff
    10     from dual
    11* )
    SQL> /
    FORMATTED
    01:05:12cheers,
    Anthony

  • Difference between two date in bex query

    Hi all,
    I need to do a difference between two date using formula variable processing type customer exit beaucause I must use factory calendar in the formula.
    How can I do it?
    Can you give me an example of the routine?
    Thanks a lot
    Gianmarco

    Hi,
    You can still use the same code to copy it and customize as per your need. All you need to do is to subract the dates using the class: CL_ABAP_TSTMP after converting to timestamp and resulting seconds you convert back to days....Please get help from the developers to do this...
    Also, ensure that you write back this difference value to your variable so you get it on the reports for your calculations...
    Cheers,
    Emmanuel.

  • Whats the difference between Cost  and (%CPU)

    whats the difference between Cost (%CPU) in the newest version of the explain plan and just Cost in the Older versions?

    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    ======================================================
    i replaced this plan.....
    create table PLAN_TABLE (
         statement_id      varchar2(30),
         timestamp      date,
         remarks      varchar2(80),
         operation      varchar2(30),
         options      varchar2(30),
         object_node      varchar2(128),
         object_owner      varchar2(30),
         object_name      varchar2(30),
         object_instance numeric,
         object_type varchar2(30),
         optimizer varchar2(255),
         search_columns number,
         id          numeric,
         parent_id     numeric,
         position     numeric,
         cost          numeric,
         cardinality     numeric,
         bytes          numeric,
         other_tag varchar2(255),
         partition_start varchar2(255),
    partition_stop varchar2(255),
    partition_id numeric,
         other          long,
         distribution varchar2(30));
    for this one...
    create table PLAN_TABLE (
    statement_id varchar2(30),
    plan_id number,
    timestamp date,
    remarks varchar2(4000),
    operation varchar2(30),
    options varchar2(255),
    object_node varchar2(128),
    object_owner varchar2(30),
    object_name varchar2(30),
    object_alias varchar2(65),
    object_instance numeric,
    object_type varchar2(30),
    optimizer varchar2(255),
    search_columns number,
    id numeric,
    parent_id numeric,
    depth numeric,
    position numeric,
    cost numeric,
    cardinality numeric,
    bytes numeric,
    other_tag varchar2(255),
    partition_start varchar2(255),
    partition_stop varchar2(255),
    partition_id numeric,
    other long,
    distribution varchar2(30),
    cpu_cost numeric,
    io_cost numeric,
    temp_space numeric,
    access_predicates varchar2(4000),
    filter_predicates varchar2(4000),
    projection varchar2(4000),
    time numeric,
    qblock_name varchar2(30),
    other_xml clob
    );

Maybe you are looking for

  • Formatted Search for Sales Order

    Hi, I setup a formatted search in Sales Order unit price field. Condition required: If Sales Order is copied from Sales Quotation, unit price remains as per Sales Quotation unit price, else formula to calculate mininum selling price appllies. Here's

  • Just updated Firefox, not sidebar scrolls too fast.

    I just updated Firefox. Now when I hold down the vertical scrolling arrow at the bottom right of the page it scrolls faster than it used to. It's too fast. How do I slow this down?

  • Safari browser running slow!

    Hi, I know this seems to be a common problem, but my iMac Safari browser has been running increasingly slowly for the last few months, when I first try to launch a new webpage it can take up to 20-30 seconds to load up. I appear to up to date with my

  • How do I install Logic Pro 8.0.2 on the latest macbook pro?

    I just bought a new macbook pro retina and realised that it does not have a disc slot to put the installation disc in! How do I install Logic Pro 8.0.2 on the latest macbook pro? Also is there a way for me to upgrade it to Logic Pro X? Please help!

  • Adobe Flash Player 10 installed but not running

    I installed Adobe Flash Player 10 from the adobe site, and it said that it installed successfully, but when I try to watch videos on facebook or youtube it says I need to download flash player.  I tried installing it again, but the install window jus