How to tune this update statement?

Hello,
I have to solve the following task:
Update every row in table A which has an appropriate row in table B and log what you have done in a log-table.
It is possible that there are more than one fitting rows in table A for a row in table B.
My first approach is looping over the table B and doing an update of table A for every entry in table B.
This works and looks like this:
Table A:
PK number (This is the primary key of this table)
KEY number
Table B:
KEY_OLD number
KEY_NEW number
Log table:
PK number
KEY_OLD number
KEY_NEW number
declare
  TYPE PK_TAB_TYPE IS TABLE OF number INDEX BY BINARY_INTEGER;
  v_tab_PK       PK_TAB_TYPE;
  v_empty_tab_PK PK_TAB_TYPE;
begin
  for v_rec in (select * from table_B) loop
    v_tab_PK := v_empty_tab_PK;  /* clearing the array */
    update table_A
    set    KEY = v_rec.KEY_NEW
    where (KEY = v_rec.KEY_OLD)
    returning PK bulk collect into v_tab_PK;
    if (v_tab_PK.count > 0) then
      for i in v_tab_PK.first..v_tab_PK.last loop
        insert into TMP_TAB_LOG(PK, KEY_OLD, KEY_NEW)
          values (v_tab_PK(i), v_rec.KEY_OLD, v_rec.KEY_NEW);
      end loop;
    end if;
  end loop;
end;Because the table B can have up to 500.000 entries (and the table A has even more entries) this solution will cause many update-statements.
So I am looking for a solution which has better performance.
My second approach was using an correlated update and looks like this:
declare
  TYPE PK_TAB_TYPE IS TABLE OF number INDEX BY BINARY_INTEGER;
  v_tab_PK            PK_TAB_TYPE;
  v_empty_tab_PK PK_TAB_TYPE;
  v_tab_NewKey    PK_TAB_TYPE;
begin
  v_tab_PK         := v_empty_tab_PK;  /* clear the arrays */
  v_tab_NewKey := v_empty_tab_PK;
  update table_A a
  set    KEY = (select KEY_NEW from table_B where (KEY_OLD = a.KEY))
  where exists (select 'x' as OK
                     from   table_B
                     where (KEY_OLD = a.KEY)
  returning PK, KEY bulk collect into v_tab_PK, v_tab_NewKey;
  if (v_tab_PK.count > 0) then
    for i in v_tab_PK.first..v_tab_PK.last loop
      insert into TMP_TAB_LOG_DUB(PK, KEY_OLD, KEY_NEW)
        values (v_tab_PK(i), null, v_tab_NewKey(i));
    end loop;
  end if;
end;Now I have only one update statement.
The only thing missing in this second approach is the old KEY before the update in the log table.
But I have no idea how to get the old value.
Is there a possibility to modify this second approach to get the old value of the KEY before the update to write it in the log-table?
And now I need your help:
What is the best way to get a performant solution for my task?
Every help appreciated.
Regards Hartmut

Below is a script you can run in another testing schema to do the update with logging..... I have created the tables (A and B) with primary key constraints defined...
create table table_a(pk number primary key
, key number);
create table table_b(key_old number primary key
, key_new number);
create table TMP_TAB_LOG_DUB(pk number primary key
, key_old number
, key_new number);
---------insert test data
insert into table_a values(1,2);
insert into table_a values(2,2);
insert into table_a values(3,2);
insert into table_a values(11,1);
insert into table_a values(12,1);
insert into table_a values(13,1);
insert into table_a values(21,4);
insert into table_a values(22,4);
insert into table_a values(23,4);
commit;
insert into table_b values(1,3);
insert into table_b values(4,2);
commit;
----- insert to log
insert into TMP_TAB_LOG_DUB(PK, KEY_OLD, KEY_NEW)
select a.pk
, a.key as key_old
, b.key_new as key_new
from table_a a
join table_b b on a.key = b.key_old;
----- update table_a
update(select a.pk
, a.key as key_old
, b.key_new as key_new
from table_a a
join table_b b on a.key = b.key_old)
set key_old = key_new;
commit;

Similar Messages

  • How to automate this update statement

    Hello:
    I need to convert this update statement to a pl/sql procedure so that I can update this for each mk_product_id at a time because the primary update table has 80 million lines, If I do this for one mk_product_id is very fast, I need to update closely 2 million lines for month_id =55
    update processor a set a.mkrptqty =
    (select b.mkqty*p.rpt_conv_factor
    from
    processor b,
    product p
    where a.mk_record_id = b.mk_record_id
    and a.mk_line_nbr = b.mk_line_nbr
    and b.mk_product_id = p.part_code
    and a.mk_product_id = '480'
    and b.month_id = 55)
    where
    a.month_id = 55
    and a.mk_product_id = '480'
    Thanks,
    Mohan

    PL/SQL is slower than SQL.
    Keep your update as a single large update statement, but better correlate your inner select with your outer table:
    UPDATE processor a
    SET a.mkrptqty =
      (SELECT b.mkqty*p.rpt_conv_factor
         FROM processor b,
        product p
        WHERE a.mk_record_id = b.mk_record_id
      AND a.mk_line_nbr      = b.mk_line_nbr
      AND b.mk_product_id    = p.part_code
      AND a.month_id         = b.month_id
      WHERE a.month_id  = 55
    AND a.mk_product_id = '480';As you can see in the above code I correleated processor b completely with processor a from the outer update statement. But in the process noticed that you could probably completely dispose of processor b as noted below:
    UPDATE processor a
    SET a.mkrptqty =
      (SELECT a.mkqty*p.rpt_conv_factor
         FROM product p
        WHERE a.mk_product_id    = p.part_code
      WHERE a.month_id  = 55
    AND a.mk_product_id = '480';Please note that neither of these pieces of code have been tested as I don't have relevant tables at hand to test on.
    To update many mk_product_id's at a time just use the IN operator providing it with either a select list, or list of values:
    UPDATE processor a
    SET a.mkrptqty =
      (SELECT a.mkqty*p.rpt_conv_factor
         FROM product p
        WHERE a.mk_product_id    = p.part_code
      WHERE a.month_id  = 55
    AND a.mk_product_id in ('480','481');or
      WHERE (a.month_id, a.mk_product_id)
         in ((55,'480'), (65,'481'));or
      WHERE (a.month_id, a.mk_product_id)
         in (select month_id, mk_product_id from some_table where some_conditions = 'are met');Edited by: Sentinel on Sep 17, 2008 2:25 PM

  • How to tune the Update statement for 20 million rows

    Hi,
    I want to update 20 million rows of a table. I wrote the PL/SQL code like this:
    DECLARE
    v1
    v2
    cursor C1 is
    select ....
    BEGIN
    Open C1;
    loop
    fetch C1 bulk collect into v1,v2 LIMIT 1000
    exit when C1%NOTFOUND;
    forall i in v1.first..v1.last
    update /*+INDEX(tab indx)*/....
    end loop;
    commit;
    close C1;
    END;
    The above code took 24 mins to update 100k records, so for around 20 million records it will take 4800 mins (80 hrs).
    How can I tune the code further ? Will a simple Update statement, instead of PL/SQL make the update faster ?
    Will adding few more hints help ?
    Thanks for your suggestions.
    Regards,
    Yogini Joshi

    Hello
    You have implemented this update in the slowest possible way. Cursor FOR loops should be absolute last resort. If you post the SQL in your cursor there is a very good chance we can re-code it to be a single update statement with a subquery which will be the fastest possible way to run this. Please remember to use the {noformat}{noformat} tags before and after your code so the formatting is preserved.
    David                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need to tune this Update statement.

    Hi..
    I have an update which I suspect is performing bad.
    UPDATE
         PS_OI_RNV_RCN_RECV R
         SET (VOUCHER_ID, VOUCHER_LINE_NUM) =
         (SELECT
                M.VOUCHER_ID ,
              M.VOUCHER_LINE_NUM
         FROM
              PS_VCHR_RECV_MTCH M
         WHERE
              M.BUSINESS_UNIT = R.BUSINESS_UNIT_GL
         AND      M.BUSINESS_UNIT_PO =  R.BUSINESS_UNIT
         AND      M.RECEIVER_ID = R.RECEIVER_ID
         AND      M.RECV_LN_NBR =  R.RECV_LN_NBR
         AND      (M.RECEIVER_ID, M.RECV_LN_NBR) IN ( SELECT M3.RECEIVER_ID ,M3.RECV_LN_NBR
                                       FROM PS_VCHR_RECV_MTCH M3
                                       WHERE
                                            M3.BUSINESS_UNIT =R.BUSINESS_UNIT_GL
                                       AND M3.BUSINESS_UNIT_PO = R.BUSINESS_UNIT
                                       AND M3.RECEIVER_ID = R.RECEIVER_ID
                                       AND M3.RECV_LN_NBR = R.RECV_LN_NBR
                                       HAVING  COUNT(*) = :"SYS_B_0"
                                       GROUP BY M3.RECEIVER_ID , M3.RECV_LN_NBR
    WHERE
           R.USERID = :"SYS_B_1"
    AND      R.RUN_CNTL_ID = :"SYS_B_2"
    AND      R.VOUCHER_ID =  :"SYS_B_3"
    AND      R.OI_RNV_STATUS = :"SYS_B_4"
    AND      EXISTS ( SELECT VOUCHER_ID ,VOUCHER_LINE_NUM FROM PS_VCHR_RECV_MTCH M2
              WHERE
                   M2.BUSINESS_UNIT = R.BUSINESS_UNIT_GL
                   AND M2.BUSINESS_UNIT_PO = R.BUSINESS_UNIT
                   AND M2.RECEIVER_ID = R.RECEIVER_ID
                   AND M2.RECV_LN_NBR = R.RECV_LN_NBR
                   AND (M2.RECEIVER_ID, M2.RECV_LN_NBR) IN ( SELECT M4.RECEIVER_ID ,M4.RECV_LN_NBR
                                                 FROM PS_VCHR_RECV_MTCH M4
                                                 WHERE M4.BUSINESS_UNIT = R.BUSINESS_UNIT_GL
                                                 AND M4.BUSINESS_UNIT_PO = R.BUSINESS_UNIT
                                                 AND M4.RECEIVER_ID = R.RECEIVER_ID
                                                 AND M4.RECV_LN_NBR = R.RECV_LN_NBR
                                            HAVING  COUNT(*) = :"SYS_B_5"
                                            GROUP BY M4.RECEIVER_ID , M4.RECV_LN_NBR
              )Plan for this Statement is
    | Id  | Operation                | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT         |                    |     1 |    59 |  7413   (1)| 00:01:29 |
    |   1 |  UPDATE                  | PS_OI_RNV_RCN_RECV |       |       |            |          |
    |*  2 |   FILTER                 |                    |       |       |            |          |
    |*  3 |    TABLE ACCESS FULL     | PS_OI_RNV_RCN_RECV |     1 |    59 |   750   (1)| 00:00:09 |
    |*  4 |    INDEX RANGE SCAN      | PS_VCHR_RECV_MTCH  |     1 |    27 |  1110   (1)| 00:00:14 |
    |*  5 |     FILTER               |                    |       |       |            |          |
    |   6 |      SORT GROUP BY NOSORT|                    |     1 |    27 |  1110   (1)| 00:00:14 |
    |*  7 |       INDEX RANGE SCAN   | PS_VCHR_RECV_MTCH  |     1 |    27 |  1110   (1)| 00:00:14 |
    |*  8 |   INDEX RANGE SCAN       | PS_VCHR_RECV_MTCH  |     1 |    40 |  1110   (1)| 00:00:14 |
    |*  9 |    FILTER                |                    |       |       |            |          |
    |  10 |     SORT GROUP BY NOSORT |                    |     1 |    27 |  1110   (1)| 00:00:14 |
    |* 11 |      INDEX RANGE SCAN    | PS_VCHR_RECV_MTCH  |     1 |    27 |  1110   (1)| 00:00:14 |
    Predicate Information (identified by operation id):
       2 - filter( EXISTS (SELECT 0 FROM "PS_VCHR_RECV_MTCH" "SYS_ALIAS_10" WHERE
                  "M2"."BUSINESS_UNIT"=:B1 AND "M2"."RECEIVER_ID"=:B2 AND "M2"."RECV_LN_NBR"=:B3 AND
                  "M2"."BUSINESS_UNIT_PO"=:B4 AND  EXISTS (SELECT 0 FROM "PS_VCHR_RECV_MTCH" "M4" WHERE
                  "M4"."BUSINESS_UNIT"=:B5 AND "M4"."RECEIVER_ID"=:B6 AND "M4"."RECV_LN_NBR"=:B7 AND
                  "M4"."BUSINESS_UNIT_PO"=:B8 GROUP BY "M4"."RECEIVER_ID","M4"."RECV_LN_NBR" HAVING
    PLAN_TABLE_OUTPUT
                  "M4"."RECEIVER_ID"=:B9 AND "M4"."RECV_LN_NBR"=:B10 AND COUNT(*)=TO_NUMBER(:SYS_B_5))))
       3 - filter("R"."VOUCHER_ID"=:SYS_B_3 AND "R"."RUN_CNTL_ID"=:SYS_B_2 AND
                  "R"."OI_RNV_STATUS"=:SYS_B_4 AND "R"."USERID"=:SYS_B_1)
       4 - access("M2"."BUSINESS_UNIT"=:B1 AND "M2"."RECEIVER_ID"=:B2 AND
                  "M2"."RECV_LN_NBR"=:B3 AND "M2"."BUSINESS_UNIT_PO"=:B4)
           filter("M2"."RECEIVER_ID"=:B1 AND "M2"."RECV_LN_NBR"=:B2 AND
                  "M2"."BUSINESS_UNIT_PO"=:B3 AND  EXISTS (SELECT 0 FROM "PS_VCHR_RECV_MTCH" "M4" WHERE
                  "M4"."BUSINESS_UNIT"=:B4 AND "M4"."RECEIVER_ID"=:B5 AND "M4"."RECV_LN_NBR"=:B6 AND
                  "M4"."BUSINESS_UNIT_PO"=:B7 GROUP BY "M4"."RECEIVER_ID","M4"."RECV_LN_NBR" HAVING
                  "M4"."RECEIVER_ID"=:B8 AND "M4"."RECV_LN_NBR"=:B9 AND COUNT(*)=TO_NUMBER(:SYS_B_5)))
       5 - filter("M4"."RECEIVER_ID"=:B1 AND "M4"."RECV_LN_NBR"=:B2 AND
                  COUNT(*)=TO_NUMBER(:SYS_B_5))
       7 - access("M4"."BUSINESS_UNIT"=:B1 AND "M4"."RECEIVER_ID"=:B2 AND
                  "M4"."RECV_LN_NBR"=:B3 AND "M4"."BUSINESS_UNIT_PO"=:B4)
           filter("M4"."RECEIVER_ID"=:B1 AND "M4"."RECV_LN_NBR"=:B2 AND
                  "M4"."BUSINESS_UNIT_PO"=:B3)
       8 - access("M"."BUSINESS_UNIT"=:B1 AND "M"."RECEIVER_ID"=:B2 AND
                  "M"."RECV_LN_NBR"=:B3 AND "M"."BUSINESS_UNIT_PO"=:B4)
           filter("M"."RECEIVER_ID"=:B1 AND "M"."RECV_LN_NBR"=:B2 AND
                  "M"."BUSINESS_UNIT_PO"=:B3 AND  EXISTS (SELECT 0 FROM "PS_VCHR_RECV_MTCH" "M3" WHERE
                  "M3"."BUSINESS_UNIT"=:B4 AND "M3"."RECEIVER_ID"=:B5 AND "M3"."RECV_LN_NBR"=:B6 AND
                  "M3"."BUSINESS_UNIT_PO"=:B7 GROUP BY "M3"."RECEIVER_ID","M3"."RECV_LN_NBR" HAVING
                  "M3"."RECEIVER_ID"=:B8 AND "M3"."RECV_LN_NBR"=:B9 AND COUNT(*)=TO_NUMBER(:SYS_B_0)))
       9 - filter("M3"."RECEIVER_ID"=:B1 AND "M3"."RECV_LN_NBR"=:B2 AND
                  COUNT(*)=TO_NUMBER(:SYS_B_0))
      11 - access("M3"."BUSINESS_UNIT"=:B1 AND "M3"."RECEIVER_ID"=:B2 AND
                  "M3"."RECV_LN_NBR"=:B3 AND "M3"."BUSINESS_UNIT_PO"=:B4)
    PLAN_TABLE_OUTPUT
           filter("M3"."RECEIVER_ID"=:B1 AND "M3"."RECV_LN_NBR"=:B2 AND
                  "M3"."BUSINESS_UNIT_PO"=:B3)
    DBMS_METADATA.GET_DDL('INDEX','PS_VCHR_RECV_MTCH')
      CREATE UNIQUE INDEX "SYSADM"."PS_VCHR_RECV_MTCH" ON "SYSADM"."PS_VCHR_RECV_MTC
    H" ("BUSINESS_UNIT", "VOUCHER_ID", "VOUCHER_LINE_NUM", "BUSINESS_UNIT_RECV", "RE
    CEIVER_ID", "RECV_LN_NBR", "RECV_SHIP_SEQ_NBR", "BUSINESS_UNIT_PO", "PO_ID", "LI
    NE_NBR", "SCHED_NBR")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 40960 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "PSINDEX"
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1   2007.68    2012.83          2  182564670       4260        4070
    Fetch        0      0.00       0.00          0          0          0           0
    total        2   2007.68    2012.83          2  182564670       4260        4070Thanks...
    Edited by: Oceaner on May 24, 2012 7:15 AM

    Hi Gokul,
    in case of no statistics most likely the optimizer would do a dynamic sampling, so ironically, no statistics is often better than statistics.
    It could be that some of the tables is used as a temp table (i.e. is filled with data to carry out some operations, and then purged), in which case the stats job could've caught it when it was empty. But even if the cardinalities would have been fine, I don't really think the optimizer has a lot of options with the query as is stands, because the aggregate subqueries restrict the ability of the optimizer to apply query transforms.
    Still, worth a shot to check if stats are accurate -- that's an easy thing to do and couldn't possibly do any harm.
    Best regards,
    Nikolay

  • How to install this update and solve USB and touchpad issues?

    I have Equium M50 (59E) and got bitten by an update that took out my touchpad and keyboard .I have made fresh install of XP Home and have all updated drivers and all is going well .The last update i cant seem to fathom is for
    Driver Ana _2005_10_24_V1.2 it is for ,Standard Open HCD USB Host Controller........X 2 .........
    The update fixes all kinds of issues of the kind i am having and is a recomended update from Driver detective ,that i use offten .
    The trouble is it says to uninstall drivers for the one i have installed allready and when i do this it knocks off my USB mouse leaving me not able to install the new ones .When i reboot it installs the ones i dont want reinstalled .
    This is the read me off the new update and realy it is beyond me to underdstand what to do ............so here it is ?
    Driver revision history:
    Twinhan VP704A Driver Release note
    Note:
    1.In case the system crashes while running with VP704A, Please install ULI
    USB 2.0 host driver in \ULiUSB20Driver
    2. For XP/SP1, please update with the patch in
    <http://www.microsoft.com/downloads/details.aspx?displaylang=zh-tw&familyid=733dd867-56a0-4956-b7fe-e85b688b7f86>
    3.In XP/SP1, updating driver will crash the system, while new install is ok.
    The trick to update driver in XP/SP1 is shown in the following steps,
    a. Uninstall the driver
    b. Unplug and plug the USB device
    c. Install the driver
    4. To support remote controller, please launch Agent.exe in \Agent.
    Further details can be found in \Agent\Readme.txt
    Known issues:
    1. Multi-instance is not supported
    2. Remote wakeup is not supported
    3. High CPU usage in Analog audio/video capture
    4. Bad VBI Signal using YUY2 color format
    5. AV out of sync if audio captured from wrong filter.
    (Fix:using the filter "USB Audio Device" in WDM stream capture device)
    6. Noise with analog-TV and FM Radio
    (Fix:using the filter "USB Audio Device" in WDM stream capture device)
    Driver revision history:
    2005/10/24, Version: 1.0.2.8
    Bugs fixed and new features:
    1.Crossbar not properly set.
    2005/10/21, Version: 1.0.2.7
    Bugs fixed and new features:
    1.Firmware version read from FLASH OK!
    2005/10/14, Version: 1.0.2.6
    Bugs fixed and new features:
    1.Mutil-Access driver blank part below part screen when VBI!
    2.Mutil-Access driver HCT driver verify crash fix!
    2005/10/07, Version: 1.0.2.5
    Bugs fixed and new features:
    1.Tuner Power off when S-Video,Composite.
    2005/09/30, Version: 1.0.2.4
    Bugs fixed and new features:
    1.Agent.exe updated for repeat bug!
    2.TI5150 Register for Video Format fix!
    2005/09/29, Version: 1.0.2.3
    Bugs fixed and new features:
    1.A trial driver build for multiple access support. (in the folder "\Multi-Access")
    Note: "USB Audio device" filter provided by system does not support mutil-Access.
    2.Reset TI5150 when a new frequency is set
    2005/09/27, Version: 1.0.2.2
    Bugs fixed and new features:
    1.Fix I2C unstable access on some devices.
    2005/09/23, Version: 1.0.2.1
    Bugs fixed and new features:
    1.Analog TV becomes darker sometimes.
    2005/09/15, Version: 1.0.2.0
    Bugs fixed and new features:
    1.Fix INF for Windows 2000 installation.
    2.FM radio scan policy changed!
    2005/09/13, Version: 1.0.1.9
    Bugs fixed and new features:
    1.USB serial number string not visible with USBView, firmware update required.
    2.FM radio scan policy, return unlock if PLLOffset>=9x12.5KHz
    2005/09/13, Version: 1.0.1.8
    Bugs fixed and new features:
    1.After switching between A/D/AV several times, video display becomes dark in THDTV 2.61
    2005/09/12, Version: 1.0.1.7
    Bugs fixed and new features:
    1.Improve channel lock status check performance
    2.Pinnacle INF Fix.
    2005/09/09, Version: 1.0.1.6
    Bugs fixed and new features:
    1.Add some audio initialization function.
    2005/08/31, Version: 1.0.1.5
    Bugs fixed and new features:
    1.NTSC & PAL mode resolution separation.
    2005/08/30, Version: 1.0.1.4
    Bugs fixed and new features:
    1.AvgTimePerFrame.
    2.Frame Drop.
    3.Pinnacle inf file HCT chkinf fail.
    2005/08/22, Version: 1.0.1.3
    Bugs fixed and new features:
    1.Add Remote controller interface in digital source filter.
    2.A new Remote controller test tool with source code in \Test_RC.
    2005/08/16, Version: 1.0.1.2
    Bugs fixed and new features:
    1.Reorg Pinnacel & Twinhan's driver & folder.
    2.VP704A_BDA_Test tool, add system code test.
    3.Set IR protocol standard by registry keys "IRSTANDARD", "IRSYSCODECHECK1" in INF file.
    4.Firmware update
    2005/08/15, Version: 1.0.1.1
    Bugs fixed and new features:
    1.Serial number function is lost while adjusting TV audio volume
    2.RC6A CIR support
    (This firmware uses GPIO3 (M9207 pin 80) to decode RC6 protocol.
    The hardware should be reworked to connect M9207 pin 80 to CIR module and the fimrware
    EEPROM should be flashed with \Firmware\M9207.bin )
    3.Serieal number, MAC address and OEM device name supported.
    Please refer to further details in \Firmware\readme.txt.
    4.Ioclt sample source code included.
    2005/08/08, Version: 1.0.0.10
    Bugs fixed and new features:
    1.Analog TV audio volume increase.
    2005/08/04, Version: 1.0.0.9
    Bugs fixed and new features:
    1.Analog TV Video mode set failure.
    2005/08/03, Version: 1.0.0.8
    Bugs fixed and new features:
    1.Off-centerf requency scan +/- 125Khz
    2.Fix duplicated program scanned in MCE.
    2005/08/02, Version: 1.0.0.7
    Bugs fixed and new features:
    1.THBDAConsole.exe "ulFixedBW", "ulDisableOffFreqScan", "ulMCEFreqTranslate" bug fixed
    2005/07/28, Version: 1.0.0.6
    Bugs fixed and new features:
    1.THBDAConsole.exe "ulFixedBW", "ulDisableOffFreqScan", "ulMCEFreqTranslate" support
    2.Improve I2C communication stability.
    3.Unify Signal strength & quality indication as THBda ioctl interface.
    4.Capture filter Lock status check.
    2005/07/28, Version: 1.0.0.5
    Bugs fixed and new features:
    1. The same signal strength & quality indications as VP7046.
    2. Debug build driver
    2005/07/21, Version: 1.0.0.4
    Bugs fixed and new features:
    1.Update INF.
    2005/07/20, Version: 1.0.0.3
    Bugs fixed and new features:
    1.Improve performance in PCM4
    2.Switching from Analog TV Mode to FM Mode failure
    2005/07/04, Version: 1.0.0.2
    Bugs fixed and new features:
    1.Production Tool FM test OK!
    And here is the readme from the other file within the update ?
    ULi PCI to USB Enhanced Host Controller Driver V1.72 for Windows 98 SE, Windows ME , Windows 2000 and Windows XP
    INTRODUCTION
    This driver supports ULi EHCI host Controller under Windows 98 SE, Windows ME , Windows 2000
    and Windows XP.
    CONTENTS OF THIS DOCUMENT
    1. Installation Instructions
    2. Uninstallation Instructions
    1. Installation Instructions
    (Windows 98 SE & Windows ME)
    A.When ULi USB 2.0 Controller has attached on system
    1. Install ULi USB2.0 Driver
    - Run the setup program.
    - This program will copy driver files into your Windows system,then restart your computer.
    2. After system reboot, Windows will find the new hardware "ULi PCI to USB Enhanced
    Host Controller" and install the driver.
    B.If no ULi USB 2.0 Controller on system
    1. Install ULi USB2.0 Driver
    - Run the setup program.
    - This program will copy driver files into your Windows system, then turn off your computer.
    - Attach ULi USB 2.0 Controller card on your system and then reboot your computer.
    2. After system reboot, Windows will find the new hardware "ULi PCI to USB Enhanced
    Host Controller" and install the driver.
    (Windows 2000)
    A.When ULi USB 2.0 Controller has attached on system
    1. Install ULi USB2.0 Driver
    - Run the setup program.
    - This program will install and load the driver and you don't have to reboot the
    computer.
    B.If no ULi USB 2.0 Controller on system
    1. Install ULi USB2.0 Driver
    - Run the setup program.
    - This program will copy driver files into your Windows system, then turn off
    your computer.
    - Attach ULi USB 2.0 Controller card on your system and then reboot your computer.
    2. After system reboot, Windows will find the new hardware "ULi PCI to USB Enhanced
    Host Controller" and install the driver.
    (Windows XP)
    A.When ULi USB 2.0 Controller has attached on system
    1. Install ULi USB2.0 Driver
    - Run the setup program.
    - Click "NEXT"
    - This program will install and load the driver and you don't have to reboot the
    computer.
    - After install ULi USB 2.0 driver successfully. System will detect "USB 2.0 Root
    Hub". Please select "install the software automatically (Recommended)" and then
    click "Next" button to continue install.
    - This program will install and load the driver and you don't have to reboot the
    computer.
    B.If no ULi USB 2.0 Controller on system
    1. Install ULi USB2.0 Driver
    - Run the setup program.
    - This program will copy driver files into your Windows system, then turn off
    your computer.
    - Attach ULi USB 2.0 Controller card on your system and then reboot your computer.
    2. After system reboot, Windows will find the new hardware "ULi PCI to USB Enhanced
    Host Controller", continue to install.
    - After install ULi USB 2.0 driver successfully. System will detect "USB 2.0 Root
    Hub". Please select "install the software automatically (Recommended)" and then
    click "Next" button to continue install.
    Notice:
    If you can't setup driver successfully. Please reboot your system and then follow
    above steps to install driver again.
    2. Uninstallation Instructions
    1. Open "Control Panel" folder.
    2. Invoke "Add\Remove Programs" icon.
    3. Choose "ULi USB2.0 Driver" item.
    4. Click on "Add/Remove" button to remove drivers.
    Change List:
    1.74
    1.fix issue that multi-interface keyboard can not be detected on the usb2.0 hub.
    2.support all USB2.0 Host Controller.
    1.73
    1.fix issue that On Win98SE , Blue screen when unplugging some USB2.0 Scanner after scanning image.
    2.fix issue that On Win98SE, Blue screen when unplugging some USB2.0 Scanner from USB 2.0 Hub after scanning image.
    3.fix issue that On Win98SE, Blue screen while copying files across the SUNBOX UH-204 Hub.
    4.fix issue that wirless lan will disconect when plug-in usb device.
    1.72
    1.Fix issue that system will crash when USB HD copy large file.
    1.71
    1.improve Power management function in Win98/ME.
    1.70
    1.Improve the function of devcie detection.
    1.62
    1.Fix the problem that a USB floppy under USB 2.0 HUB cannot function when system resume from suspend.
    1.61
    1.Fix the problem that some USB device under USB 2.0 HUB cannot be found if system resume from suspend.
    1.60
    1.To support power management functions when a HUB with USB device plug into
    a root HUB.
    1.57
    1.Fix USB floppy with USB 2.0 HUB can't be detect issue.
    2.Fix issue that audio can't display smooth when USB device attach to system.
    3.Fix system can't detect USB dvice when USB device attach to system in
    suspend mode.
    4.Fix issue that when USB root HUB have full loading, USB HD sometimes
    transaction fail.
    1.56
    1. Fix issue that DVD decoder device can't display properly.
    1.55
    1. Fix OTI USB 2.0 hand drive can't be detect issue.
    2. Fix USB mouse can't use after resume from suspend.
    1.54
    1.Improve driver security.
    1.53
    1. Fix bulk transfer may stop if USB device is plugged in USB 2.0 hub
    2. Fix USB 2.0 mass storage device can't be access after resuming from standby if there is another USB 1.1 device existing
    1.52
    1. Fix system pages fault when accessing mass storage device in Win98SE, or scandisk failure when selecting
    automatically fix file system errors
    2. Fix system may hang up in Win98SE/ME if USB 2.0 cardbus card is plugged
    v.1.51
    1. Improve USB 2.0 cardreader compatibility.
    2. Fix USB IDE devices can't be accessed after resuming from standby/hibernation.
    v1.50
    1. Improve bulk transfer
    v1.48
    1. Fix USB 2.0 LAN driver installation hanging up
    2. Fix some USB 1.1 cardreader can't be identified when plugged into USB 2.0 hub
    3. Fix some laptops Win98SE booting hanging up
    v1.47
    1. Improve bulk transfer performance.
    2. Fix USB 2.0 bulk webcam preview failure.
    v1.46
    1. Support USB 2.0 and 1.1 Isochronous devices
    2. Fix system hanging up when rebooting system if USB 2.0 host controller is disabled in Win9X/ME
    3. Fix system hanging up when uninstalling driver if there are USB 2.0 devices connected in Win2K/XP
    4. Improve device detection capability in Win9X/ME
    v1.45
    1. Fix system hanging up when resuming from ACPI sleep mode.
    2. Fix mouse sometimes doesn't disappear when it's unplugged.
    3. Fix Win9X composite device detection failure and improve Win2K/XP composite device
    v1.44
    1. Support composite device
    2. Improve device detection
    v1.43
    1. Improve IDE read/write transfer failure rate with USB 2.0 to IDE bridge on PC card platform
    2. Fix high-speed device detected as full-speed device
    3. Fix some USB mouses detection failure problem
    4. Fix some USB 2.0 hubs detection failure problem
    5. Fix Win98SE crashing if ULi EHCI 1.42 is installed
    v1.42
    1. Fix PC Card ejection hanging up in Win98/ME
    2. Fix suspend/resume hanging up in Win98
    3. Solve sometimes USB 1.1 device can't be detected if OS boots with USB 2.0 and 1.1 devices plugged
    4. Fix some PC Card USB 1.1 device detection failure
    v1.41
    1. Add new feature that system can install driver before device is plugged.
    2. Fix PCMCIA OHCI controller resource assign issue on Windos ME.
    v1.40
    1. Support Win9X/ME/2K/XP with ULi USB 2.0 driver.
    2. Fix PCMCIA EHCI controller detecting USB 2.0 device problem in Win9X/ME.
    v1.32
    1. Fix issue that driver can't detect Microsoft driver in Windows XP
    if OS path is not c:\windows.
    2. Fix issue that driver can't detect USB 2.0 controller device in in some system.
    v1.31
    1. Fix issue that driver can't install on Windows 2000.
    v1.30
    1. Fix issue that Win9X/ME shows no USB 2.0 Root Hub.
    2. Fix issue that hanging up when second entry into Win9X S1 with HID device plugged.
    3. Fix issue that sometimes when you click "Scan for hardware changes".
    to PNP ULi USB2.0 controller, system will informs you the usbehci.sys
    file can't be found.
    4. Fix issue that v1.20 finds no EHCI controller to install driver for after different
    verison of ULi EHCI controller devices are plugged and unplugged.
    5. Support installing driver for more than one ULi EHCI controller devices existing on
    system at the same time.
    6. Fix Win2K/XP shows USB Root Hub for USB 2.0 Root Hub.
    v1.20
    1.Support ULi USB 2.0 Host controller driver for Windows 98SE/ME/2000/XP.
    ULi Coporation. (ULi) web sites:
    http://www.uli.com.tw/ (Taiwan)
    CAN ANYONE TREAT ME LIKE A TWO YEAR OLD AND GIVE SOME GUIDANCE AS TO HOW TO ACHIEVE THIS UPDATE .
    i WOULD BE VERY GRATEFULL AND KIND OF THINK IT WOULD BE BENIFICIAL TO A LOT MORE PEOPLE AS I SEE A LOT OF XP AND PROBLEMS OF THE KIND THIS UPDATE IS SUPPOSED TO FIX .

    It says above 2 relevant and 1 correct answere available .............
    I'm new here so could anyone direct me to these answeres?

  • Help with this update statement..

    Hi everyone,
    I am trying to update a column in a table .I need to update that column
    with a function that takes patient_nbr and type_x column values as a parameter.
    That table has almost "300,000" records. It is taking long time to complete
    almost 60 min to 90 min.
    Is it usual to take that much time to update that many records?
    I dont know why it is taking this much time.Please help with this update statement.
    select get_partner_id(SUBSTR(patient_nbr,1,9),type_x) partner_id from test_load;
    (it is just taking 20 - 30 sec)
    I am sure that it is not the problem with my function.
    I tried the following update and merge statements .Please correct me if i am wrong
    in the syntax and give me some suggestions how can i make the update statement fast.
    update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
    merge into test_load a
    using (select patient_nbr,type_x from test_load) b
    on (a.patient_nbr = b.patient_nbr)
    when matched
    then
    update
    set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
    there is a index on patient_nbr column
    and the statistics are gathered on this table.

    Hi Justin,
    As requested here are the explain plans for my update statements.Please correct if i am doing anything wrong.
    update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 3793814442"
    "| Id  | Operation          | Name             | Rows  | Bytes | Cost (%CPU)| Time     |"
    "|   0 | UPDATE STATEMENT   |                  |   274K|  4552K|  1488   (1)| 00:00:18 |"
    "|   1 |  UPDATE            |        TEST_LOAD |       |       |            |          |"
    "|   2 |   TABLE ACCESS FULL|        TEST_LOAD |   274K|  4552K|  1488   (1)| 00:00:18 |"
    merge into test_load a
    using (select patient_nbr,type_x from test_load) b
    on (a.patient_nbr = b.patient_nbr)
    when matched
    then
    update
    set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 1188928691"
    "| Id  | Operation            | Name             | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |"
    "|   0 | MERGE STATEMENT      |                  |   274K|  3213K|       |  6660   (1)| 00:01:20 |"
    "|   1 |  MERGE               |        TEST_LOAD |       |       |       |            |          |"
    "|   2 |   VIEW               |                  |       |       |       |            |          |"
    "|*  3 |    HASH JOIN         |                  |   274K|    43M|  7232K|  6660   (1)| 00:01:20 |"
    "|   4 |     TABLE ACCESS FULL|        TEST_LOAD |   274K|  4017K|       |  1482   (1)| 00:00:18 |"
    "|   5 |     TABLE ACCESS FULL|        TEST_LOAD |   274K|    40M|       |  1496   (2)| 00:00:18 |"
    "Predicate Information (identified by operation id):"
    "   3 - access("A"."patient_nbr"="patient_nbr")"Please give some suggestions..
    what's the best approach for doing the updates for huge tables?
    Thanks

  • I have an update required for Evernote in my Imac app store, but cannot find how to get this update. It says to sign in with my emailm address, but I cannot find a way to do this.  Please help!!

    I recently downloaded Mlountain Lion on my Imac. It shows that I have an update for Evernote that should be downloaded, but I cannot find out how to complete this update. It asks for me to sign in with my email address, but does not show how to do this.  Please help!

    I have done exactly what you said. When I check "update", a screen  drops down that asks that I enter my email address to continue........but i cannot find any way to do this.
    In the past, all I would do is check "update", and the update would take place. Since I upgraded to Mountain Lion, this has changed, and i do not know how to do this simple thing.......the app store shows an update is due to be updated, but i cannot find out how to do it.

  • How to tune this query for the improve performance ?

    Hi All,
    How to tune this query for the improve performance ?
    select a.claim_number,a.pay_cd,a.claim_occurrence_number,
    case
    when sum(case
    when a.payment_status_cd ='0'
    then a.payment_est_amt
    else 0
    end
    )=0
    then 0
    else (sum(case
    when a.payment_status_cd='0'and a.payment_est_amt > 0
    then a.payment_est_amt
    else 0
    end)
    - sum(case
    when a.payment_status_cd<>'0'
    then a.payment_amt
    else 0
    end))
    end as estimate
    from ins_claim_payment a
    where a.as_of_date between '31-jan-03' and '30-aug-06'
    and ( a.data_source = '25' or (a.data_source between '27' and '29'))
    and substr(a.pay_cd,1,1) IN ('2','3','4','8','9')
    group by a.claim_number, a.pay_cd, a.claim_occurrence_number
    Thank you,
    Mcka

    Mcka
    As well as EXPLAIN PLAN, let us know what proportion of rows are visited by this query. It may be that it is not using a full table scan when it should (or vice versa).
    And of course we'd need to know what indexes are available, and how selective they are for the predicated you have in this query ...
    Regards Nigel

  • How to optimize this select statement  its a simple select....

    how to optimize this select statement  as the records in earlier table is abt i million
    and this simplet select statement is not executing and taking lot of time
      SELECT  guid  
                    stcts      
      INTO table gt_corcts
      FROM   corcts
      FOR all entries in gt_mege
      WHERE  /sapsll/corcts~stcts = gt_mege-ctsex
      and /sapsll/corcts~guid_pobj = gt_Sagmeld-guid_pobj.
    regards
    Arora

    Hi Arora,
    Using Package size is very simple and you can avoid the time out and as well as the problem because of memory.  Some time if you have too many records in the internal table, then you will get a short dump called TSV_TNEW_PAGE_ALLOC_FAILED.
    Below is the sample code.
    DATA p_size = 50000
    SELECT field1 field2 field3
       INTO TABLE itab1 PACKAGE SIZE p_size
       FROM dtab
       WHERE <condition>
    Other logic or process on the internal table itab1
    FREE itab1.
    ENDSELECT.
    Here the only problem is you have to put the ENDSELECT.
    How it works
    In the first select it will select 50000 records ( or the p_size you gave).  That will be in the internal table itab1.
    In the second select it will clear the 50000 records already there and append next 50000 records from the database table.
    So care should be taken to do all the logic or process with in select and endselect.
    Some ABAP standards may not allow you to use select-endselect.  But this is the best way to handle huge data without short dumps and memory related problems. 
    I am using this approach.  My data is much more huge than yours.  At an average of atleast 5 millions records per select.
    Good luck and hope this help you.
    Regards,
    Kasthuri Rangan Srinivasan

  • HT5744 Anyone knows how to uninstall this update?

    Hi
    I want to uninstall this update from my system, (knowing security risk, doesn't care security if hardware doesn't work)
    I know that this update was compiled with a unestable and buggy Oracle Java version not RC, was beta and Apple put it like RC.
    Please how to uninstall this update?

    The Software update version is bonked, the latest bug fix is here for 10.6 users.
    https://support.apple.com/kb/DL1573
    Pasting: java -version into Terminal and pressing Enter should reveal this after the update which fixes the bug.
    java version "1.6.0_51"
    Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-10M4509)
    Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

  • How to do this Update

    I need to add a 'serial_no' column to a table. The existing PK consists of non-consecutive values. The serial_no column which should follow the ordering of the PK and increased by exactly 1 for the next pk. How to write this UPDATE? I cannot use 'UPDATE t SET serial_no=ROWNUM' as the result is not guaranteed to be following the order of the PK.
    pk, serial_no
    10, 1
    12, 2
    14, 3
    18, 4
    ....

    here is one way to do :
    SQL> select * from t;
    PK SERIAL_NO
    10
    12
    14
    18
    1 merge into t using (select pk, row_number() over (order by pk) rn from t) a
    2 on (t.pk = a.pk)
    3* when matched then update set t.serial_no = a.rn
    SQL> /
    4 rows merged.
    SQL>
    SQL> select * from t;
    PK SERIAL_NO
    10 1
    12 2
    14 3
    18 4

  • The latest Firefox update, installed this morning 6/21/2011, disabled McAfee. After installation, a window appeared stating that McAfee was not compatible and couldn't be enabled. This is NOT ACCEPTABLE! Please let me know how to uninstall this update.

    The latest Firefox update, installed this morning 6/21/2011, disabled McAfee. After installation, a window appeared stating that McAfee was not compatible and couldn't be enabled. This is NOT ACCEPTABLE! Please let me know how to uninstall this update.

    Upgrade your browser to Firefox 8 and check
    * getfirefox.com

  • How to tune this SQL?

    What this SQL did is to generate a report like how many rows for each tp_stts when ims_toms_msge_type='TOMS NEW' (or 'TOMS CNCLO'). also, its corresponding total number for each ims_toms_msge_type.
    Here is the sample:
    Rownum    H1            TP_STTS                          COUNT        IMS_TOMS_MSGE_TYPE    H   FILTERTYPE
    1     Trades     Block Key Data Error                      594           TOMS NEW             A     MSL
    2          Allocation Data Error                      334           TOMS NEW             A     MSL
    3          Manual Processing Required                29           TOMS NEW             A      MSL
    4          Manual Removal No Processing Required     67           TOMS NEW             A      MSL
    5          Waiting For Authorization                 2            TOMS NEW             A     MSL
    6           Auto NAK                             19764          TOMS NEW             B     SLS
    7           Validated                             165023         TOMS NEW             B     SLS
    8     GRAND TOTAL                                    185813          TOMS NEW              H     MSL
    9     Cancel     Auto NAK                              37             TOMS CNCLO        X       MSL
    10          Manual Processing Required   114                    TOMS CNCLO          X      MSL
    11          Manually Processed              278                   TOMS CNCLO     X     MSL
    12     CANCEL GRAND TOTAL                        429                TOMS CNCLO           Z      MSLSQL statement as below:
    SELECT ROWNUM, MSGS.* FROM (with FTMReport as (
           select tp_stts, ims_toms_msge_type, count(*) count  from ims_trde, ims_toms_msge
                    where  ( IMS_TRDE.PRCSG_GRP_ID  = 5  )  AND  ( IMS_TRDE.IMS_TRDE_RCPT_DTTM  >= TO_DATE('12/01/2009 00:00', 'MM/DD/YYYY HH24:MI') AND IMS_TRDE.IMS_TRDE_RCPT_DTTM <= (TO_DATE('12/28/2009 23:59', 'MM/DD/YYYY HH24:MI'))  )  AND (IMS_TRDE.GRS_TRX_TYPE NOT IN ('INJECTION','WITHDRAWAL','PAYMENT') OR IMS_TRDE.GRS_TRX_TYPE IS NULL) AND (IMS_TRDE.SSC_INVST_TYPE != 'FC' OR IMS_TRDE.SSC_INVST_TYPE IS NULL) AND (IMS_TRDE.SERVICE_TYPE='FS' OR IMS_TRDE.SERVICE_TYPE='CO')  AND 1=1 
        and IMS_TRDE.SERVICE_TYPE='FS'    and  1=1  and ims_trde.ims_trde_oid = ims_toms_msge.ims_trde_oid
           group by tp_stts, ims_toms_msge_type
          select 'GRAND TOTAL' H1,  null tp_stts, sum(Count) count , ims_toms_msge_type ,'H', 'MSL' FilterType
                   from FTMReport  where  ims_toms_msge_type in ('TOMS NEW') group by ims_toms_msge_type
        union
          select 'CANCEL GRAND TOTAL' H1,  null tp_stts, sum(Count) count, ims_toms_msge_type ,'Z', 'MSL' FilterType 
                   from FTMReport where  ims_toms_msge_type in ('TOMS CNCLO') group by ims_toms_msge_type
        union
          select DECODE(rownum, 1, 'Trades') H1, tp_stts, count, ims_toms_msge_type , 'A' , 'MSL' FilterType
                   from FTMReport  where  ims_toms_msge_type in ('TOMS NEW') and tp_stts not in ('Validated','Auto NAK','Manual NAK')
        union
          select ' ' H1, tp_stts, count, ims_toms_msge_type , 'B' , 'SLS' FilterType
                   from FTMReport where  ims_toms_msge_type in ('TOMS NEW') and tp_stts in ('Validated','Auto NAK','Manual NAK')
        union
          select DECODE(rownum, 1, 'Cancel') H1, tp_stts, count, ims_toms_msge_type , 'X' , 'MSL' FilterType
                   from FTMReport where  ims_toms_msge_type in ('TOMS CNCLO') order by 5,6
        ) MSGS;Explain plan as below:
    | Id  | Operation                           |  Name                        | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT                    |                              |   193 | 12738 |    32 |
    |   1 |  COUNT                              |                              |       |       |       |
    |   2 |   VIEW                              |                              |   193 | 12738 |    32 |
    |   4 |    TEMP TABLE TRANSFORMATION        |                              |       |       |       |
    |   3 |     RECURSIVE EXECUTION             | SYS_LE_4_0                   |       |       |       |
    |   0 |      INSERT STATEMENT               |                              |    61 |  4575 |  9264 |
    |   1 |       LOAD AS SELECT                |                              |       |       |       |
    |   2 |        SORT GROUP BY                |                              |    61 |  4575 |  9264 |
    |   3 |         NESTED LOOPS                |                              |  1604 |   117K|  9251 |
    |*  4 |          TABLE ACCESS BY INDEX ROWID| IMS_TRDE                     |  1603 | 80150 |  6045 |
    |*  5 |           INDEX RANGE SCAN          | IMS_TRDE_INDX4               |   539K|       |  3917 |
    |*  6 |          INDEX RANGE SCAN           | IMS_TOMS_MSGE_INDX1          |     1 |    25 |     2 |
    |   5 |     SORT UNIQUE                     |                              |   193 |  8831 |    30 |
    |   6 |      UNION-ALL                      |                              |       |       |       |
    |   7 |       SORT GROUP BY NOSORT          |                              |     5 |   115 |     6 |
    |*  8 |        VIEW                         |                              |    61 |  1403 |     2 |
    |   9 |         TABLE ACCESS FULL           | SYS_TEMP_0FD9D660F_B198D56F  |    61 |  2074 |     2 |
    |  10 |       SORT GROUP BY NOSORT          |                              |     5 |   115 |     6 |
    |* 11 |        VIEW                         |                              |    61 |  1403 |     2 |
    |  12 |         TABLE ACCESS FULL           | SYS_TEMP_0FD9D660F_B198D56F  |    61 |  2074 |     2 |
    |  13 |       COUNT                         |                              |       |       |       |
    |* 14 |        VIEW                         |                              |    61 |  2867 |     2 |
    |  15 |         TABLE ACCESS FULL           | SYS_TEMP_0FD9D660F_B198D56F  |    61 |  2074 |     2 |
    |* 16 |       VIEW                          |                              |    61 |  2867 |     2 |
    |  17 |        TABLE ACCESS FULL            | SYS_TEMP_0FD9D660F_B198D56F  |    61 |  2074 |     2 |
    |  18 |       COUNT                         |                              |       |       |       |
    |* 19 |        VIEW                         |                              |    61 |  2867 |     2 |
    |  20 |         TABLE ACCESS FULL           | SYS_TEMP_0FD9D660F_B198D56F  |    61 |  2074 |     2 |
    Predicate Information (identified by operation id):
       4 - filter(("IMS_TRDE"."GRS_TRX_TYPE"<>'INJECTION' AND "IMS_TRDE"."GRS_TRX_TYPE"<>'WITHDRAWAL'
                  AND "IMS_TRDE"."GRS_TRX_TYPE"<>'PAYMENT' OR "IMS_TRDE"."GRS_TRX_TYPE" IS NULL) AND
                  ("IMS_TRDE"."SSC_INVST_TYPE"<>'FC' OR "IMS_TRDE"."SSC_INVST_TYPE" IS NULL))
       5 - access("IMS_TRDE"."IMS_TRDE_RCPT_DTTM">=TO_DATE(' 2009-12-01 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "IMS_TRDE"."PRCSG_GRP_ID"=5 AND "IMS_TRDE"."SERVICE_TYPE"='FS' AND
                  "IMS_TRDE"."IMS_TRDE_RCPT_DTTM"<=TO_DATE(' 2009-12-28 23:59:00', 'syyyy-mm-dd hh24:mi:ss'))
           filter("IMS_TRDE"."PRCSG_GRP_ID"=5 AND "IMS_TRDE"."SERVICE_TYPE"='FS')
       6 - access("IMS_TRDE"."IMS_TRDE_OID"="IMS_TOMS_MSGE"."IMS_TRDE_OID")
       8 - filter("FTMREPORT"."IMS_TOMS_MSGE_TYPE"='TOMS NEW')
      11 - filter("FTMREPORT"."IMS_TOMS_MSGE_TYPE"='TOMS CNCLO')
      14 - filter("FTMREPORT"."IMS_TOMS_MSGE_TYPE"='TOMS NEW' AND "FTMREPORT"."TP_STTS"<>'Validated'
                  AND "FTMREPORT"."TP_STTS"<>'Auto NAK' AND "FTMREPORT"."TP_STTS"<>'Manual NAK')
      16 - filter("FTMREPORT"."IMS_TOMS_MSGE_TYPE"='TOMS NEW' AND ("FTMREPORT"."TP_STTS"='Auto NAK' OR
                  "FTMREPORT"."TP_STTS"='Manual NAK' OR "FTMREPORT"."TP_STTS"='Validated'))
      19 - filter("FTMREPORT"."IMS_TOMS_MSGE_TYPE"='TOMS CNCLO')
    Note: cpu costing is offCould you guys tell me what is wrong with this sql and how to tune it?
    Is there any way to replace the UNION? Is using UNION a good idea?
    Can I use DECODE or CASE WHEN to simplify it? How?
    Also, could you help explain why there is SYS_LE_4_0, SYS_TEMP_0FD9D660F_B198D56F temporary segment? Is it caused by with FTMReport as ?
    Thanks
    Edited by: PhoenixBai on Dec 31, 2009 9:58 AM
    Edited by: PhoenixBai on Dec 31, 2009 12:08 PM
    Edited by: PhoenixBai on Dec 31, 2009 12:17 PM

    I consider using GROUP BY ROLLUP together with DECODE, CASE WHEN, but haven`t come out with a working sql yet:-(Some sample data to work with would have been much helpful. But we dont get that most of the time :(
    I came up with this.
                    select case when ims_toms_msge_type = 'TOMS NEW' then
                                     case when grouping(tp_stts) = 1 then 'GRAND TOTAL'
                                          when tp_stts not in ('Validated','Auto NAK','Manual NAK') then 'Trades'
                                     end
                                when ims_toms_msge_type = 'TOMS CNCLO' then
                                     case when grouping(tp_stts) = 1 then 'CANCEL GRAND TOTAL'
                                          when tp_stts in ('Validated','Auto NAK','Manual NAK') then 'Cancel'
                                     end
                           end h1,
                           tp_stts,
                           count(*) count,
                           ims_toms_msge_type,
                           case when ims_toms_msge_type = 'TOMS NEW' then
                                     case when grouping(tp_stts) = 1 then 'H'
                                          when tp_stts not in ('Validated','Auto NAK','Manual NAK') then 'A'
                                     end
                                when ims_toms_msge_type = 'TOMS CNCLO' then
                                     case when grouping(tp_stts) = 1 then 'Z'
                                          when tp_stts in ('Validated','Auto NAK','Manual NAK') then 'B'
                                     end
                           end flag,
                           'MSL' FilterType
                   from ims_trde,
                        ims_toms_msge
                     where IMS_TRDE.PRCSG_GRP_ID  = 5 
                       AND IMS_TRDE.IMS_TRDE_RCPT_DTTM  >= TO_DATE('12/01/2009 00:00', 'MM/DD/YYYY HH24:MI')
                       AND IMS_TRDE.IMS_TRDE_RCPT_DTTM <=  TO_DATE('12/28/2009 23:59', 'MM/DD/YYYY HH24:MI') 
                       AND (IMS_TRDE.GRS_TRX_TYPE NOT IN ('INJECTION','WITHDRAWAL','PAYMENT')
                        OR IMS_TRDE.GRS_TRX_TYPE IS NULL)
                       AND (IMS_TRDE.SSC_INVST_TYPE != 'FC'
                        OR IMS_TRDE.SSC_INVST_TYPE IS NULL)
                       AND (IMS_TRDE.SERVICE_TYPE = 'FS'
                        OR IMS_TRDE.SERVICE_TYPE = 'CO')
                       AND 1=1 
                     and IMS_TRDE.SERVICE_TYPE = 'FS'   
                     and  1=1 
                     and ims_trde.ims_trde_oid = ims_toms_msge.ims_trde_oid
                      group by rollup(ims_toms_msge_type, tp_stts)Not sure if this code works. Because i dint have the table or the data to test it. So if it has some error just fix it and give it a try. Do post the kind of output it gives. So that we can see if we can work with this solution.

  • Need help on how to code this SQL statement! (one key has leading zeros)

    Good day, everyone!
    First of all, I apologize if this isn't the best forum.  I thought of putting it in the SAP Oracle database forum, but the messages there seemed to be geared outside of ABAP SELECTs and programming.  Here's my question:
    I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    Unfortunately, I don't have a lot of experience coding SQL, so I'm not sure how to resolve this.
    Please help!  As always, I will award points to ALL helpful responses!
    Thanks!!
    Dave

    >
    Dave Packard wrote:
    > Good day, everyone!
    > I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    >
    > The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    > Dave
    You can't do a join like this in SAP's open SQL.  You could do it in real SQL ie EXEC.... ENDEXEC by using SUSBTR to strip off the leading zeros from AUFNR but this would not be a good idea because a)  modifying a column in the WHERE clause will stop any index on that column being used and b) using real SQL rather than open SQL is really not something that should be encouraged for database portability reasons etc. 
    Forget about a database join and do it in two stages; get your AUFK data into an itab, strip off the leading zeros, and then use FAE to get the FMIFIIT data (or do it the other way round). 
    I do hope you've got an index on your FMIFIIT MEASURE field (we don't have one here); otherwise your SELECT could be slow if the table holds a lot of data.

  • Possible to check how much time an update statement on a table would take ?

    Hello @all
    I have a table with a fragmented Index, the table has an actula "user_updates" from 226'699.
    How can i find out how much time an update on this table takes ?
    i would like to check if there is any performance increase when i regroup the index (rebuild), cause the index has a fragementation of 85% now... (or should i delete the index completely) cause there are no user_seeks... only user_updates on the table...
    and i thought that indexes only makes sense if users are reading from the table... am i wrong ? (cause on every update from the table, the index (indexes) have to be updated too...
    Thanks and Regards
    Dominic

    Rebuilding the index will not likely result in a modification be quicker. At least not more than marginal. In fact, it might wven be slower, since if you currently have space on the index page for the new row and then rebuild so you *don't* have space then
    the index rebuild will make that update be slower (at least for the cases where you get page splits). 
    However if the index isn't used to find rows (any of the other three columns), then you have an index which only cost you and doesn't help you!
    Tibor Karaszi, SQL Server MVP |
    web | blog
    Tibor, check out this forum thread:
    http://social.technet.microsoft.com/Forums/sqlserver/en-US/64ad4f52-2fd8-4266-b4a4-5657c8870246/needed-more-answerers?forum=sqlgetstarted
    Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

Maybe you are looking for