Find the average time required to process an order?

Hello

I followed four tables.
/* There are other columns as well but just using the relevent columns.*/

CREATE TABLE COMPANY_ORDERS
(
  INTERNALORDERID            NUMBER(10)         NOT NULL,
  ORDERENTRYDATE             DATE,
  SYSTEMID             NUMBER(10)
)

/* There are other columns as well but just using the relevent columns.*/
/* The data in archive table goes after each three months.*/
CREATE TABLE COMPANY_ORDERS_ARCH
(
  INTERNALORDERID            NUMBER(10)         NOT NULL,
  ORDERENTRYDATE             DATE,
  SYSTEMID             NUMBER(10)
)

/* There are other columns as well but just using the relevent columns.*/
CREATE TABLE COMPANY_ORDER_HISTORY
(
  INTERNALORDERID   NUMBER(10)                  NOT NULL,
  ITEMORDER         NUMBER(10)                  NOT NULL,
  ENTRYDATE         DATE                        NOT NULL,
  UPDATEDATE        DATE,
  STATUSID          NUMBER(10),
  INTERNALSTATUSID  NUMBER(10)
)
/* The data in archive table goes after each three months.*/
CREATE TABLE COMPANY_ORDER_HISTORY_ARCH
(
  INTERNALORDERID   NUMBER(10)                  NOT NULL,
  ITEMORDER         NUMBER(10)                  NOT NULL,
  ENTRYDATE         DATE                        NOT NULL,
  UPDATEDATE        DATE,
  STATUSID          NUMBER(10),
  INTERNALSTATUSID  NUMBER(10)
)
The data in TABLE COMPANY_ORDER_HISTORY or COMPANY_ORDER_HISTORY_ARCH of the TABLE can be used as below:
SET DEFINE OFF;
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179058, 8, TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), 7, 1360);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179058, 10, TO_DATE('08/03/2009 11:42:16', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:42:16', 'MM/DD/YYYY HH24:MI:SS'), 7, 1430);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179180, 1, TO_DATE('08/03/2009 10:21:30', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 10:21:30', 'MM/DD/YYYY HH24:MI:SS'), -3, -3);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179180, 3, TO_DATE('08/03/2009 10:25:06', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 10:25:06', 'MM/DD/YYYY HH24:MI:SS'), 0, 0);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179180, 14, TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), 7, 1360);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179180, 16, TO_DATE('08/03/2009 11:42:17', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:42:17', 'MM/DD/YYYY HH24:MI:SS'), 7, 1430);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179184, 1, TO_DATE('08/03/2009 10:21:33', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 10:21:33', 'MM/DD/YYYY HH24:MI:SS'), -3, -3);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179184, 3, TO_DATE('08/03/2009 10:25:09', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 10:25:09', 'MM/DD/YYYY HH24:MI:SS'), 0, 0);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179184, 14, TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), 7, 1360);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179184, 16, TO_DATE('08/03/2009 11:42:18', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:42:18', 'MM/DD/YYYY HH24:MI:SS'), 7, 1430);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179185, 1, TO_DATE('08/03/2009 10:21:33', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 10:21:33', 'MM/DD/YYYY HH24:MI:SS'), -3, -3);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179185, 3, TO_DATE('08/03/2009 10:25:09', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 10:25:09', 'MM/DD/YYYY HH24:MI:SS'), 0, 0);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179185, 14, TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:40:00', 'MM/DD/YYYY HH24:MI:SS'), 7, 1360);
Insert into COMPANY_ORDER_HISTORY
   (INTERNALORDERID, ITEMORDER, ENTRYDATE, UPDATEDATE, STATUSID, INTERNALSTATUSID)
 Values
   (8179185, 16, TO_DATE('08/03/2009 11:42:17', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/03/2009 11:42:17', 'MM/DD/YYYY HH24:MI:SS'), 7, 1430);
COMMIT;
Every day an order number is raised through different systems (identified by COMPANY_ORDERS. SYSTEMID). Now I need to find a day average time an order made, by SYSTEMID to reach a final statusid 7 (x), internalstausid 1430 (y) of his first entrytime in COMPANY_ORDER_HISTORY (IE for an orderid, the first entry of COMPANY_ORDER_HISTORY founded in updatedate or for an orderid, or the entrytime for an orderid when ITEMORDER = 1)

Tables of archive can be reunited if the fake of the length of the period for which the order is archived.

Another desired suggestion is table archive is very large.
It will be appropriate to create a materialized view archived table, not seen that data last month and then join the Materialized view query (since the statistics must be shown to last a year...)?

Concerning

Published by: a R on October 28, 2009 06:02

Published by: a R on October 28, 2009 14:13

Hello

First, initialize variables bind using some PL/SQL like this:

-- These parameters are passed by the user:
VARIABLE  p_statusid          NUMBER
VARIABLE  p_internalstatusid     NUMBER
VARIABLE  p_start_date          VARCHAR2 (10)
VARIABLE  p_end_date          VARCHAR2 (10)

-- These parameters are derived from the ones that are passed:
VARIABLE  p_date_trunc          VARCHAR2 (10)
VARIABLE  p_need_arch          NUMBER

DECLARE
       end_date     DATE;
       start_date     DATE;
BEGIN
       :p_statusid     := 7;
       :p_internalstatusid     := 1430;
       :p_start_date := '03/08/2009';
       :p_end_date   := '04/08/2009';

       start_date := TO_DATE (:p_start_date, 'DD/MM/YYYY');
       end_date   := TO_DATE (:p_end_date,   'DD/MM/YYYY');

--       The following parameters could be computed in the query, but it's messier

       :p_date_trunc := CASE
                    WHEN  end_date - start_date <= 1
                    THEN  'HH'
                    WHEN  MONTHS_BETWEEN (end_date, start_date) <= 1
                    THEN  'DD'
                    WHEN  MONTHS_BETWEEN (end_date, start_date) <= 6
                    THEN  'IW'
                    ELSE  'MM'
                     END;

       :p_need_arch := CASE
                    WHEN  start_date > ADD_MONTHS (SYSDATE, -4)
                    THEN  0       -- dates are all within last 4 months, archive tables are not needed
                    ELSE  1       -- some dates are older than 4 months ago, archive tables are needed
                          END;
END;
/

You don't absolutely have to do that, but it made the query much shorter and cleaner.

The query itself is:

WITH       dop     AS
(
     SELECT     systemid,     internalorderid
     FROM     company_orders
     WHERE     orderentrydate >= TO_DATE (:p_start_date, 'DD/MM/YYYY')
     AND     orderentrydate <  TO_DATE (:p_end_date,   'DD/MM/YYYY') + 1
          --
     UNION ALL
             --
     SELECT     systemid,     internalorderid
     FROM     company_orders_arch
     WHERE     orderentrydate >= TO_DATE (:p_start_date, 'DD/MM/YYYY')
     AND     orderentrydate <  TO_DATE (:p_end_date,   'DD/MM/YYYY') + 1
     AND     :p_need_arch   = 1
)
,     coh     AS
(
     SELECT       internalorderid
     ,       MIN ( CASE
                        WHEN  itemorder     = 1
                  THEN      entrydate
                  END
                )          AS h1_entrydate
     ,       MAX ( CASE
                        WHEN  internalstatusid     = :p_internalstatusid
                  AND      statusid           = :p_statusid
                  THEN      entrydate
                  END
                )          AS hn_entrydate
     FROM       company_order_history
     WHERE       entrydate     >= TO_DATE (:p_start_date, 'DD/MM/YYYY')
     GROUP BY  internalorderid
                  --
     UNION ALL
                  --
     SELECT       internalorderid
     ,       MIN ( CASE
                        WHEN  itemorder     = 1
                  THEN      entrydate
                  END
                )          AS h1_entrydate
     ,       MAX ( CASE
                        WHEN  internalstatusid     = :p_internalstatusid
                  AND      statusid           = :p_statusid
                  THEN      entrydate
                  END
                )          AS hn_entrydate
     FROM       company_order_history_arch
     WHERE       entrydate     >= TO_DATE (:p_start_date, 'DD/MM/YYYY')
     AND       :p_need_arch     = 1
     GROUP BY  internalorderid
)
SELECT       dop.systemid
,       AVG (coh.hn_entrydate - coh.h1_entrydate)     AS avereagetime
,       TO_CHAR ( TRUNC (coh.hn_entrydate, :p_date_trunc)     --  + (1 / 24)
              , 'MM/DD/YYYY' || CASE
                         WHEN  :p_date_trunc = 'HH'
                         THEN  ' HH24:MI:SS'
                            END
            )     AS periodstartdate
FROM       dop
JOIN       coh     ON     coh.internalorderid     = dop.internalorderid
GROUP BY  dop.systemid
,       TRUNC (coh.hn_entrydate, :p_date_trunc)
ORDER BY  dop.systemid
,            TRUNC (coh.hn_entrydate, :p_date_trunc)
;

The conditions

     AND     :p_need_arch   = 1

should "short-circuit" queries on the archived tables when it comes from kniown, the: parameter of p_start_date, that they are not necessary.

The coh subquery matches your original of subqueries h1 and h2. It is more effective to go through the tables only once. The WHERE clause in coh contain the conditions common to h1 and h2; conditions that apply only to the h1 or h2 are transferred in CASE expressions.

You always want to group by a date that is truncated. According to the: p_strart_date to: p_end_date Beach, you can truncate the next time down, day, week or month. the only difference is the 2nd argument to the TRUNC function.
When you group by weeks, I used the ISO weeks, which begin Monday and end on Sunday. If you need a different kind of week, it's a little more complicated.

Tags: Database

Similar Questions

  • Show the average time in days hours minutes seconds

    Hello

    I have two tables as follows,

    Is it possible to separate the average time in days, hours, minutes, seconds.

    I need the average time required for each account.

    with
    Table1 as
    (select "AAA" acname, 123 tid, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') ltime Union double all the )
    Select 'AAA', 456, to_date (January 11, 15 15:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 'BBB', 789, to_date (11 January 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 'CCC', 990, to_date (11 January 15 18:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 'BBB', 880, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 'DDD', 770, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 'BBB', 555, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double
    ),
    Table2 as
    (select txid 123, to_date (January 11, 15 14:00 ',' dd-mm-aa hh24:mi:ss') mtime of union double all the )
    Select 456, to_date (January 11, 15 16:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 789, to_date (11 February 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union
    Select 770, to_date (11 February 15 07:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 990, to_date (11 January 15 23:30 ',' mm-dd-aa hh24:mi:ss') of all the double union
    Select 880, to_date (11 February 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union
    Select 555, to_date (11 February 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double
    )
    Choose acname, avg (hrs)
    from (select distinct t1.acname, (t2.mtime - t1.ltime) * 24 h )
    from table1 t1,
    Table2 t2
    where t1.tid = t2.txid
    )
    Group acname


    Expected results


    ACNAME Avg (day) APR (hrs) Avg (Mins) Avg (dry)

    AAA 0 1 0 0 (that is to say 14:00-13:00 = 1 and 16 15 = 1, Avg = (1 + 1) / 2 = 1)

    BBB          1               0          0               0

    CCC          0               5          30             0

    DDD          1               2          0               0

    with

    Table1 as

    (select 'AAA' acname, 123 tid, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') ltime Union double all the)

    Select 'AAA', 456, to_date (January 11, 15 15:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 'BBB', 789, to_date (11 January 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select "CCC", 990, to_date (11 January 15 18:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 'BBB', 880, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 'DDD', 770, to_date (11 January 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 'BBB', 555, to_date (January 11, 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double

    ),

    Table2 as

    (select txid 123, to_date (January 11, 15 14:00 ',' dd-mm-aa hh24:mi:ss') mtime of union double all the)

    Select 456, to_date (January 11, 15 16:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 789, to_date (11 February 15 04:00 ',' dd-mm-aa hh24:mi:ss') of all the double union

    Select 770, to_date (11 February 15 07:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 990, to_date (11 January 15 23:30 ',' mm-dd-aa hh24:mi:ss') of all the double union

    Select 880, to_date (11 February 15 05:00 "," dd-mm-yy hh24:mi:ss') of all the double union

    Select 555, to_date (11 February 15 13:00 ',' dd-mm-aa hh24:mi:ss') of double

    )

    Select acname,

    trunc (AVG (Days)) days,

    trunc (mod (AVG (Days), 1) * 24) hours,

    trunc (mod (AVG (Days) * 24.1) * 60) minutes.

    trunc (mod (AVG (Days) * 24 * 60.1) * 60) seconds

    from (select distinct t1.acname,(t2.mtime-t1.ltime) days

    FROM table1 t1,

    table2 T2

    where t1.tid = t2.txid

    )

    Acname group

    /

    ACN DAYS HOURS MINUTES SECONDS

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

    BBB         31          0          0          0

    CCC          0          5         30          0

    AAA          0          1          0          0

    DDD         31          1          0          0

    SQL >

    SY.

  • How to check the "average time WAITED.

    I find huge "log file sync" v$ session events.
    and I want to check the «average time waited to review»
    but where and how to find the total "wait time" event? (time waited way = time / waiting time)

    Query V$ SYSTEM_EVENT where event = "synchronize file journal." However, this gives you cumulative statistics (TIME_WAITED, TIME_WAITED_MICRO, TOTAL_WAITS, AVERAGE_WAIT) since the Instance was started.

    For hourly statistics, look at the AWR reports, if you Pack diagnosis.

    (Or write your own scripts to retrieve v $ SYSTEM_EVENT and compare the numbers every hour)

  • Find the average value of a buffer

    Hello

    In my VI Panel, I have a digital control, a button and a digital display.

    When the user, enter a number in numerical order and press the button, the digital display should show the average value of all the past 5 values entered in the digital control, for example:

    1st entry: 10-online average = 10 (as sum = 10)

    2nd type: 0-online average = 5 (as sum = 10 + 0 = 10)

    3rd enter: 5-online average = 5 (you get the idea...)

    4 enter: 1-average online = 4

    5 enter: 14-online medium = 6

    6 enter: 2-online average = 4.4 (sum = 0 + 5 + 1 + 14 + 2 = 22, because the 1st value is thrown)

    How to write this VI?

    Thank you!!

    You can also use arrays to hold the data in a registry change and find the average value of the last five items.

    Good luck

  • How do you find the last time that an address older Windows Live Hotmail has been used if you don't remember the password?

    How do you find the last time an old hotmail address was used... especially if you can't remember the exact password?

    original title: old hotmail address

    How do you find the last time an old hotmail address was used... especially if you can't remember the exact password?

    Good enough if you can't on the account and you can't prove it is yours in order to regain access (via password self-service reset, etc)-then you won't know anything about the account.

  • [HE] can I find the average Dove / invoices?

    Nel pannello di controllo sono presenti transazioni solo mio, inutili finished tax, Dove posso find the average full di partita IVA mia e di Adobe?

    Where can I find invoices with VAT codes to my membership of the CC?

    OK solved, my fault. I have to go to adobe.com to creative.adobe.com... Thank you

  • Says Lightroom serial number entered is not valid after repair of the system occurred, require disabling series in order to reactivate the same computer

    Says Lightroom serial number entered is not valid after repair of the system occurred, require disabling series in order to reactivate the same computer

    Can you please send me the serial number, you have a private message ?

  • Find the average of a set of times

    Hi all

    I have a spreadsheet with 52 pages (weeks of the year, sort of a planner) and every day I type in my wake-up time. Until the end of the week there are 7 times, then a column that has successfully made the average at that time. (see below) using this formula: AVERAGEIF(A3:G3,">5:59",A3:G3)

    I intentionally do include only periods after 05:59 in the formula.

    As you can see it does that very well. All the averages for each week are then sent to an "annual" table on another page (see below)

    The problem when coming to this second table, each average weeks appears in the average annual table always shows the last time which was received (in this case, 09:22). In other words, it does not indicate the average. The formula I use for this table is: AVERAGEIF(C2:BC2,">5:59",C2:BC2)

    So what on earth am I doing wrong?

    Thank you :-)

    I can't read anything in the second table you have posted... it's too small.

    Perhaps to show how the weekly averages go weekly table at the annual table.

  • Need help finding the average across lines

    Hi all

    I have a requirement to find a way to several columns in a row. The trickiest part is it may or may not be a value in each of the lines and the average must be calculated for those that have a value. Let me give you an example:

    col1 col2 col2, col4

    1 NULL 3 5-> average will be (1 + 3 + 5) / 3 = 3
    NULL NULL 2 4-> average will be (2 + 4) / 2 = 3.

    A (acc to me dump) option is to get the entire file in the variable % ROWTYPE, scan through each of the columns, see if the value is not null and greater than 0, increment the counter (i) and calculate the sum. Finally make a sum / I. An average was 215 columns that it takes on average and having a separate if end seems illogical. There must be a smart solution to find this kind of average. Help, please.

    Thank you
    Aristides

    Hey,.

    SELECT (nvl (col1, 0), nvl (col2, 0), nvl (col3, 0) + nvl (col4, 0)) / (nvl2 (col1, 1, 0) + nvl2 (col2, 1, 0) + nvl2 (col3, 1, 0) + nvl2 (col4, 1, 0))
    Table_name FROM

    I hope this helps.

    -Annick

  • Find the average Timestamp

    Hey,.

    I have a table with two columns: FILE_ID (NUMBER), ARRIVAL_TIME (TIMESTAMP).

    I want to understand the ARRIVAL_TIME medium of a given file. I can't find how to do this. When I try to run the following:

    SELECT AVG (V.ARRIVAL_TIME)
    FILE_ARRIVALS V WHERE FILE_ID = SOME_NUMBER

    I get this error:

    ORA-00932: inconsistent data types: expected NUMBER obtained TIMESTAMP

    I found a lot of examples to get the average period between two dates or timestamps, but they didn't fit my needs.

    Thank you!

    Jeffrey Kevin Pry

    Published by: jeffrey.pry on August 19, 2010 05:44

    If you are looking for just the time of day, then you might do something like:

    SQL> WITH t AS (
      2     SELECT 1 file_id, sysdate arrival_time FROM dual UNION ALL
      3     SELECT 1, sysdate + 1 FROM dual UNION ALL
      4     SELECT 1, sysdate - 2 FROM dual UNION ALL
      5     SELECT 2, sysdate - 3 FROM dual UNION ALL
      6     SELECT 2, sysdate FROM dual)
      7  SELECT file_id, TO_DATE(AVG(time_secs), 'sssss')
      8  FROM (SELECT file_id, TO_NUMBER(TO_CHAR(arrival_time, 'sssss')) time_secs
      9        FROM t)
     10  GROUP BY file_id;
    
       FILE_ID TO_DATE(AVG(TIME_SEC
    ---------- --------------------
             1 01-aug-2010 08:57:14
             2 01-aug-2010 08:57:14
    

    John

  • find the last time that a procedure has been called

    Hi DBAs,

    How to find when a procedure or function was called again in 10g. Besides, even when a table last access. If this can be done without activating the audit? is there a such views or tips to find such changes?

    Thank you!

    Without verification, it is not possible, generally speaking.

    If a procedure has side effects, you could potentially look through the database to find these side effects. If inserting a new row in a table with a SYSDATE CREATE_DATE, it would be very useful. If you mean a function that does not have the side effects, however, it is not an option. If the function or procedure works for a relatively long period, his performances can be picked up in an AWR / statspack report. But it is unlikely that each execution would be seized, it is unlikely that the history is kept very long, and it is not always trivial to these research reports for the last time that a procedure has been run. And if you have a relatively quick process, it is unlikely that the executions would be ever recorded.

    Statistics at the level of the segment could give you advice on access to the table. But these statistics are cumulative since the last restart. And there are likely background processes that affect all tables at certain interval (i.e. statistics collection), which is probably not the kind of 'access', you are interested.

    Justin

  • How to get the average time of the day

    Hello

    Oracle 11g R2. Looking for a way to determine an average duration of the day. The data in the table are the following and are stored as VARCHAR2. These data represent the time of day a work finished and is stored each day in the table.

    (HH)

    00:21:45

    00:25:03

    00:23:09

    00:30:10

    Hello

    You want to use the AVG function, but that doesn't work on the number, it must convert the strings to numbers (for example, the NUMBER of days, 0-1), so get the average and then convert them to a string.

    SELECT TO_CHAR (TRUNC (SYSDATE) + AVG (TO_DATE (str, "HH24:MI:SS")

    -TRUNC (SYSDATE, 'MONTH')

    )

    , "HH24:MI:SS".

    ) AS avg_time

    FROM table_x;

    ATTENTION: the average of 23:50 to 00:50:00 will be 12:20, 00:20:00 not.  23:50 is 23 hours later at 00:50, not 1 hour earlier.

    Of course, you will get an error if even 1 of the strings is not valid.

  • Pavillion 17334: hp pavillion could not find the second time warner wifi

    My wifi has two different connections. One is a 2.4 G and the other is a 5G. My HP Pavilion sees the 2.4 G, but not the 5G. How it connects to the 5G? I tried setting up manually, but it still does not work.

    Hello:

    Most likely, the (card) wireless network adapter is only a single card band (2.4 GHz) only.

    If you let me know which model of laptop wireless card is, I confirm my opinion on the matter.

    If you are unsure which model of your laptop wireless network card has, go to Device Manager, expand the category cards network and you will find the model number and name of the wireless network adapter.

    Or, you can confirm yourself... If the model suffix ends with b/g/n, the map only works on the 2.4 GHz band.

    Double band (2.4 GHz/5.0 GHz) Wireless-N cards have suffixes ending in a, b, g, d or a/g/n.

  • How do you find the average value of all the data between two points on a single channel

    I'm tring to calculate the average value of all data points in a single field between two distinct points

    I rasthaus an illustration.

    Hi smoothdurban,

    I thought you wanted to specify the area of interest with the sliders of the band.  If you rather automatically define the area of interest based on thresholds, etc., we cannot see the interactive nature of the example I sent.

    What are the criteria used to determine the start and end of the region of interest lines?

    I would be able to type this out for you if you sent a representative data set ([email protected])

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • How to find the approximate time of a timestamp array stamp

    Hello

    Someone you will suggest a logic to determine the index of a table of time stamp for a specified time stamp constant.

    The table may not contain the exact time of seconds specified. It can be close to the time value.

    (The time stamps can have approximately 10,000 items)

    Thank you...

    This is an approach that is nearest to the index with the timestamp:

Maybe you are looking for

  • Is it possible to combine the profiles of two different computers?

    I have tons of favorite links and toolbars on both computers. I want to start using one of them and want to combine all the bookmarks, etc.. Is there a way to do this?

  • This digitizer pen is compatible with the Z10T-A Portege

    Hi all I have the z10t cell model, an i5 4G telstra.This model did not come with the digitizer pen or stylus and I wonder if the pens are compatible.Website says the pen is compatible with the Z series but am not sure. Anyone can shed some light on t

  • HP Pavilion 180 t - size case by default/Original fan

    Hello.I would like to know the size of the rear case fan in my HP Pavilion 180 t, which I haven't changed at all since it was purchased about 5 years ago.I measured the size of it as being ~ 120mm diagonal and ~ 90mm of diameter approximately, but do

  • Connectivity issues after upgrade to 6.5.0 remotely

    Hello After the upgrade to 6.5.0 I had naturally create and update an account MyNetgear to use ReadyCloud on our 2 NAS boxes. At the beginning it was a headache because he beat absolutely all remote access (as others in the forum mentioned). However,

  • Windows 10 Info Center is boring!

    Please help me! Is it possible to disable the Windows Info Center? I mean especially the gesture to open (wide right in the Center), because it really sucks when you use the ThinkPad with a pen. Thanks in advance!