Correlated update

Hi all,
i have a problem with running a update.
I have written this script
UPDATE artikel orgineel
SET "verkoopprijs" = (SELECT up_verkoop
FROM kun_up nieuw
WHERE orgineel."Nr_" = nieuw.UP_NR);
running this script gives me the followinf response from the server:
SET "verkoopprijs" = (SELECT up_verkoop
ERROR at line 2:
ORA-01722: invalid number
What is happening here? Both the columns are of the same type. (varchar2) and the data inside the columns is the same.
Somebody?????
Regards Johan Louwers

Hi Johan....
I'd say that Oracle is converting one of VARCHAR2's into a NUMBER - and is having trouble.
Why Oracle is doing that is a good question. A DESCRIBE of the two tables would be helpful to understand why.
Hope this helps, Good Luck.

Similar Messages

  • Global correlation update

    Hi,
    Will the IPS go offline during a global correlation update? We are running sensor version 7.1.(7)E4 and are noticing drops due to the IPS being unavailable. The timing of theses matches global correlation updates on the IPS.                      

    We are receiving the following log entry when global correlation updates.
    %ASA-3-420001: IPS card not up and fail-close mode used, dropping TCP packet from InterfaceA:x.x.x.x/xx to InterfaceB:y.y.y.y/yy

  • Global Correlation update Failure error

    Hello,
    I have received following error in IPS regarding global correlation update
    A global correlation update failed: ExecLoadCollabUpdate control transaction failed: Control transaction cannot be completed at this time
    is any one aware about this error? is it major issue and affecting IPS? I think this is because correlation update failure. Please let me know if any one has more information on this error

    Whenever a global correlation update fails, an evError event is generated. The error message is included in sensor statistics. The following conditions result in a status message with the severity of Error:
    •The sensor is unlicensed
    •No DNS or HTTP proxy server is configured
    •The manifest exchange failed
    •An update file download failed
    •Applying or committing the update failed
    For global correlation update fails, refer
    http://www.cisco.com/c/en/us/support/docs/security/ips-4200-series-sensors/50360-ids-faq.html

  • Global Correlation Update Failures

    I've recently turned on Global Correlation but we've failed to update every 5 minutes.
    PL-ASA-IPS# show stat global
    Network Participation:
       Counters:
          Total Connection Attempts = 2
          Total Connection Failures = 0
          Connection Failures Since Last Success = 0
       Connection History:
          Connection Attempt on February 16 2010, at 14:28:38 UTC = Successful
          Connection Attempt on February 16 2010, at 14:19:06 UTC = Successful
    Updates:
       Status Of Last Update Attempt = Failed
       Time Since Last Successful Update = never
       Counters:
          Update Failures Since Last Success = 4
          Total Update Attempts = 4
          Total Update Failures = 4
       Update Interval In Seconds = 300
       Update Server = update-manifests.ironport.com
       Update Server Address = 204.15.82.17
       Current Versions:
          config = 0
          drop = 0
          ip = 0
          rule = 0
    Warnings:
    I have a static NAT translation for the IPS, there are no proxy servers in our enviorment and it can ping outside as well as update-manifests.ironport.com (204.15.82.17). DNS is setup as well.
    In the logs I see this entry:
    16Feb2010 14:13:15.679 265.199 collaborationApp[491] rep/E A global correlation update failed: Failed download of ibrs/1.1/config/default/1236210407 : HTTP connection failed
    I guess I'm at a loss for what else I can check. We have no problems sending the Network Participation data but we can't get any data. Any suggestions?
    Cisco Intrusion Prevention System, Version 7.0(2)E3
    Signature Definition:
        Signature Update    S469.0                   2010-02-11
        Virus Update        V1.4                     2007-03-02
    OS Version:             2.4.30-IDS-smp-bigphys

    I have the same issue, i have no ASA or websense product between this device and the iNet.
    Does anyone have a fix or workaround?
    I have an AIM-IPS running 7.0(6)E4 with Signature versuon S599.0. All updates to date have been manualy d/l to a local ftp server
    the auto update "seems" to run but never gets any updates
    This is what i see
    # sh stat global
    Network Participation:
       Counters:
          Total Connection Attempts = 127
          Total Connection Failures = 127
          Connection Failures Since Last Success = 127
       Connection History:
          Connection Attempt on October 06 2011, at 10:46:32 UTC = Failed
          Connection Attempt on October 06 2011, at 09:24:32 UTC = Failed
          Connection Attempt on October 06 2011, at 08:03:04 UTC = Failed
          Connection Attempt on October 06 2011, at 07:59:52 UTC = Failed
          Connection Attempt on October 06 2011, at 06:36:57 UTC = Failed
    Updates:
       Status Of Last Update Attempt = Failed
       Time Since Last Successful Update = never
       Counters:
          Update Failures Since Last Success = 2702
          Total Update Attempts = 2702
          Total Update Failures = 2702
       Update Interval In Seconds = 300
       Update Server = update-manifests.ironport.com
       Update Server Address = Unknown
       Current Versions:
          config = 0
          drop = 0
          ip = 0
          rule = 0
    Warnings:
    #sh ver
    Application Partition:
    Cisco Intrusion Prevention System, Version 7.0(6)E4
    Host:
        Realm Keys          key1.0
    Signature Definition:
        Signature Update    S599.0                 2011-09-29
    OS Version:             2.6.14-Cavium-Octeon
    Platform:               AIM-IPS-K9
    Serial Number:          xxx
    Licensed, expires:      31-Mar-2012 UTC
    Sensor up-time is 9 days.
    Using 54726656 out of 454148096 bytes of available memory (12% usage)
    system is using 22.4M out of 80.0M bytes of available disk space (28% usage)
    application-data is using 46.8M out of 213.0M bytes of available disk space (23% usage)
    boot is using 54.4M out of 114.8M bytes of available disk space (50% usage)
    application-log is using 61.8M out of 513.0M bytes of available disk space (12% usage)
    MainApp            B-BEAU_2011_SEP_10_00_30_7_0_5_45   (Ipsbuild)   2011-09-10T00:32:09-0500   Running
    AnalysisEngine     B-BEAU_2011_SEP_10_00_30_7_0_5_45   (Ipsbuild)   2011-09-10T00:32:09-0500   Running
    CollaborationApp   B-BEAU_2011_SEP_10_00_30_7_0_5_45   (Ipsbuild)   2011-09-10T00:32:09-0500   Running
    CLI                B-BEAU_2011_SEP_10_00_30_7_0_5_45   (Ipsbuild)   2011-09-10T00:32:09-0500
    Upgrade History:
    * IPS-AIM-K9-7.0-6-E4       17:39:07 UTC Sat Sep 10 2011
      IPS-sig-S599-req-E4.pkg   07:59:08 UTC Wed Oct 05 2011
    Recovery Partition Version 1.1 - 7.0(6)E4
    Host Certificate Valid from: 25-Sep-2011 to 25-Sep-2013
    >
    as seen above there is no ip address listed for "update-manifests.ironport.com"
    NS lookup is able to resolve,
    why can't the IPS?
    I can i hard code the ip address?
    >Non-authoritative answer:
    >Name:    update-manifests.ironport.com
    >Address:  204.15.82.17

  • Correlated Update ANSI style

    Want to rewrite:
    Update table fred
    set description = ( select description from detail_table
    where fred.type_col = detail.type_col )
    Into ansi style ie. using 'join x on ' syntax how is it done?
    Thanks in advance.

    That will only work if you can satisfy oracle that you are key-preserving the joinTrue.
    But the same general problem applies to correlated updates and merge. If the correlated subquery returns multiple rows, you'll get the "single row subquery" error. If merge finds multiple rows in the using table, you'll get the "stable set of rows" error.
    One advantage to updatable views is that Oracle will throw the exception immediately (which is good if you're about to update a few million rows).
    But I agree that updatable views don't often work because of the key preserved problem.
    There have been several times I've tried them, but no go.

  • Question on correlated update

    Greeting gurus. I expect the following demo will get id populated as 1.2.3.....100 but its all 1. why or why not working ?
    create table ynot ( id number, sd date)
    insert into ynot(sd)
    select sysdate + rownum from dual connect by level < 101
    select * from ynot
    update ynot xx set xx.id = ( select row_number() over (partition by null order by sd ) from ynot yy where xx.sd = yy.sd )
    select * from ynot

    Table ynot has 100 different values for sd (today +1 to today +100)
    The subquery asks for rows
    from ynot yy where xx.sd = yy.sd
    There can only be one row from ynot where sd matches the value in the current xx.sd, so the subquery only finds one row.
    E.g. when updating the row where sd = sysdate + 50 the correlation value xx.sd is sysdate + 50 and there is only one row with that value, so the
    row_number() over (partition by null order by sd )
    is counting rows from a set of 1 rows, which is why it always gives 1 as the result.
    You seem to be expecting the analytic clause to look outside the subquery, but it can't do that.
    One way to do what I think you want to do is via a  merge:
    merge into YNOT dst
    using (select rowid rid, row_number() over (partition by null order by sd ) rnum  from ynot) src
    on ( dst.rowid = src.rid )
    when matched then update set id = src.rnum

  • How to use outer join in Corelated Update?

    Hi,
    I am using outer join in correlated update comand. But it is not updating the line which is not retrived from the query. Below is the example.
    Update model_table a
    Set a.model = (Select b.model_name from parts_table b
                        where b.model_id (+) = a.model_id)Check the above query and please let me know whether can user like this or not?
    Thanks

    Updating the values you want through subqueries is tricky. The correlated update should perform okay if the join columns are indexed but updating the correct rows may take some thought.
    You might need to add a WHERE clause to the update to use the subquery to only update the rows when the subquery return value is not null - if this is what you want. Something like
    Update model_table a
    Set a.model = (Select b.model_name from parts_table b
                        where b.model_id = a.model_id)
    where exists (Select b.model_name from parts_table b
                        where b.model_id = a.model_id)Edited by: riedelme on Jan 4, 2010 5:59 AM

  • Better method for update query

    Thanks in advance for any help you can offer on this...
    I have two tables:
    DETAIL_TABLE with columns: email_address, invalid_format_indicator, source, create_date
    SUMM_TABLE with columns: run_date, source, email_address_cnt, invalid_email_address_cnt
    Each week I run a job that truncates, then inserts new rows into the DETAIL_TABLE of email addresses that are likely invalid (invalid_format_indicator = 'Y'), and the source system ("source") that created them, as well as the date they were created in our system. Later in the process of that same job, I add new rows into SUMM_TABLE with counts.
    So, for data:
    DETAIL_TABLE:
    email_address|invalid_format_indicator|source|create_date
    joe.aol.com|Y|web|2011-03-01
    mary@myurl|Y|web|2011-03-05
    larry 2yahoo.com|Y|phone|2011-03-06
    After the DETAIL_TABLE is refreshed, new rows (14 of them) are inserted into the SUMM_TABLE whereby it creates a new row for each source. What I then want to do is update the 'invalid_email_address_cnt' field by counting the number of rows in DETAIL_TABLE, grouping by source.
    Right now, I'm running 14 update queries simultaneously--one for each source.
    Data looks like this after the update is complete (bear in mind, it's being updated via 14 separate queries):
    SUMM_TABLE
    run_date|source|email_address_cnt|invalid_email_address_cnt
    2011-03-06|web|25|5
    2011-03-06|phone|3|1
    2011-03-06|loader|20|4
    2011-03-06|source14|5|2
    It looks like this BEFORE the update:
    run_date|source|email_address_cnt|invalid_email_address_cnt
    2011-03-06|web||
    2011-03-06|phone||
    2011-03-06|loader||
    2011-03-06|source14||
    I'm currently running this update statement:
    Update SUMM_TABLE S
    set invalid_email_address_cnt =
    (Select count(*)
    from DETAIL_TABLE D
    where D.source = 'web'
    and D.invalid_format_indicator = 'Y')
    where S.run_date = sysdate
    and S.source = 'web';
    I repeat this query 13 more times-- one for each source. Ick...
    I'd like to consolidate it to one query. I prefer not using PL/SQL. The tool I'm using doesn't support PL/SQL (It's an open source ETL tool), so if I can do this via straight SQL (Oracle compliant) that would be ideal.
    Any help would be greatly appreciated!

    I believe you just want a correlated update
    Update SUMM_TABLE S
       set invalid_email_address_cnt =
          (Select count(*)
            from DETAIL_TABLE D
           where D.source = s.source
             and D.invalid_format_indicator = 'Y')
    where S.run_date = sysdate;I'm not sure, though, about the WHERE clause. Surely you mean TRUNC(sysdate) or you're using a local variable that you used to insert the row into the summary table. Otherwise, if you get unlucky and the clock ticks while your procedure is running, the update may not affect any rows.
    Justin

  • 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;

  • Correlated subqueries

    what is the use of correlated subqueries and exists and not exists operator.
    what is correlated update, correlated delete
    thx
    pk

    First step is to look for "correlated" into the on-line doc :
    http://www.oracle.com/pls/db92/db92.drilldown?levelnum=2&toplevel=a96540&method=FULL&chapters=0&book=&wildcards=1&preference=&expand_all=&verb=&word=correlated#a96540
    That may help you.
    Nicolas.

  • Update w/self referencing select?

    Hey;
    This doesn't seem like it should be too difficult; however, I can't seem to wrap my head around it.
    I have a table w/following structure:
    city
    state
    region
    Due to the way the table is getting populated, some of the regions are null. Such that:
    madison
    wisconsin
    Midwest
    and
    milwaukee
    wisconsin
    <null>
    I would like to periodically update the region column with relevent information.
    I'm pretty sure I need a look up table and have already generated one:
    create table as
    (select unique state region
    from regions where region is not null);
    but, I can't quite seem to grasp the sql to update the regions table from the lookup. Probably my procedural programming mindset getting in the way again.
    Can someone provide the needed clue?
    Thanks.
    Doug O'Leary

    Hey;
    Thanks for the replies. I see I need to explain how the table's getting populated.
    The city/state are geting added via an external source - a script that hits an external site to gather information then pump it into the database. The external site doesn't have any requirement, interest, or info on the region - that's my requirement. A query I'll be writing i the future will hunt up inventory in a region. So far, I've updated a bunch of the regions manually
    update regions
    set region = 'northwest'
    where state i ('xxx','yyy','zzz');
    Every time a new city gets added, though, the region is null. Explains why there are some null values and why I can't (at least, not yet) add a foreign key constraint.
    Since I do have most of the states and the regions, I should be able to update the states that have null regions with the information from the states that don't.
    I'm betting I just made the whole thing a lot murkier, but that explains how I got to where I am.
    Thanks for any hints/tips/suggestions.
    Doug
    //a few seconds later
    After i posted this, I saw the correlated update. That's exactly what I was looking for. I was pretty sure it'd be something like that (hence the subject); however, I just can't quite grasp that yet... <sigh> more practice.
    Thanks alot for the suggestion. it was perfect.
    Doug
    Edited by: dkoleary on Nov 10, 2009 7:06 AM

  • Long running update statement needs a performance improve.

    Hi,
    I have the following update statement which runs for over 3 hours and updates 215 million rows, is there anyway I can rewrite it so it performs better?
    UPDATE TABLE1 v
            SET closs = (SELECT MIN(slloss)
                               FROM TABLE2 l
            WHERE polnum = slpoln
            AND      polren = slrenn
            AND      polseq = slseqn
            AND      vehnum = slvehn
            AND      linecvg = sllcvg);Here is the execution plan:
    PLAN_TABLE_OUTPUT
    | Id  | Operation                     | Name        | Rows  | Bytes | Cost (%CPU)|
    |   0 | UPDATE STATEMENT              |             |   214M|  4291M|  2344K  (2)|
    |   1 |  UPDATE                       | TABLE1      |       |       |            |
    |   2 |   TABLE ACCESS FULL           | TABLE1      |   214M|  4291M|  2344K  (2)|
    |   3 |   SORT AGGREGATE              |             |     1 |    21 |            |
    |   4 |    TABLE ACCESS BY INDEX ROWID| TABLE2      |     1 |    21 |     5   (0)|
    |   5 |     INDEX RANGE SCAN          | TABLE2_N2   |     2 |       |     3   (0)|
    ----------------------------------------------------------------------------------Here are create table statements for TABLE1(215million rows) and TABLE2(1million rows):
    CREATE TABLE  TABLE2 (SLCLMN VARCHAR2(11 byte),
        SLFEAT NUMBER(2), SLPOLN NUMBER(9), SLRENN NUMBER(2),
        SLSEQN NUMBER(2), SLVEHN NUMBER(2), SLDRVN NUMBER(2),
        SLCVCD VARCHAR2(6 byte), SLLCVG NUMBER(4), SLSABB
        VARCHAR2(2 byte), SLPRCD VARCHAR2(3 byte), SLRRDT
        NUMBER(8), SLAYCD NUMBER(7), SLCITY VARCHAR2(28 byte),
        SLZIP5 NUMBER(5), SLCEDING VARCHAR2(1 byte), SLCEDELOSS
        VARCHAR2(1 byte), SLRISKTYPE VARCHAR2(1 byte), SLVEHDESIG
        VARCHAR2(1 byte)) 
        TABLESPACE S_DATA PCTFREE 10 PCTUSED 0 INITRANS 1
        MAXTRANS 255
        STORAGE ( INITIAL 106496K NEXT 0K MINEXTENTS 1 MAXEXTENTS
        2147483645 PCTINCREASE 0)
        NOLOGGING
        MONITORING;
    CREATE TABLE  TABLE1 (POLNUM NUMBER(9) NOT NULL,
        POLREN NUMBER(2) NOT NULL, POLSEQ NUMBER(2) NOT NULL,
        VEHNUM NUMBER(2) NOT NULL, CVGCODE VARCHAR2(8 byte) NOT
        NULL, LINECVG NUMBER(4), MAINVEH CHAR(1 byte), MAINCVG
        CHAR(1 byte), CVGLIMIT VARCHAR2(13 byte), CVGDED
        VARCHAR2(10 byte), FULLCVG CHAR(1 byte), CVGGRP CHAR(4
        byte), CYCVG CHAR(1 byte), POLTYPE CHAR(1 byte),
        CHANNEL CHAR(2 byte), UWTIER VARCHAR2(6 byte), SUBTIER
        VARCHAR2(6 byte), THITIER VARCHAR2(3 byte), COMPGRP
        VARCHAR2(8 byte), PRODGRP VARCHAR2(6 byte), UWSYS
        VARCHAR2(6 byte), BRAND VARCHAR2(8 byte), COMP NUMBER(2),
        STATE CHAR(2 byte), PROD CHAR(3 byte), RRDATE DATE,
        STATENUM NUMBER(2), EFT_BP CHAR(1 byte), AGYCODE
        NUMBER(7), AGYSUB CHAR(3 byte), AGYCLASS CHAR(1 byte),
        CLMAGYCODE NUMBER(7), AGYALTCODE VARCHAR2(25 byte),
        AGYRELATION VARCHAR2(10 byte), RATECITY VARCHAR2(28 byte),
        RATEZIP NUMBER(5), RATETERR NUMBER, CURTERR NUMBER,
        CURRRPROD CHAR(6 byte), CURRRDATE DATE, RATESYMB NUMBER,
        SYMBTYPE CHAR(1 byte), CVGTERR NUMBER(3), CVGSYMB
        NUMBER(3), VEHTERR NUMBER, VEHYEAR NUMBER, VEHMAKE
        VARCHAR2(6 byte), VEHMODEL VARCHAR2(10 byte), VEHSUBMOD
        VARCHAR2(10 byte), VEHBODY VARCHAR2(6 byte), VEHVIN
        VARCHAR2(10 byte), VEHAGE NUMBER(3), VEHSYMB NUMBER,
        DRVNUM NUMBER, DUMMYDRV CHAR(1 byte), DRVAGE NUMBER(3),
        DRVSEX VARCHAR2(1 byte), DRVMS VARCHAR2(1 byte), DRVPTS
        NUMBER(3), DRVPTSDD NUMBER(3), DRVGRP CHAR(7 byte),
        DRVSR22 VARCHAR2(1 byte), DRVVTIER CHAR(2 byte),
        BUSUSESUR CHAR(1 byte), EXCLDRVSUR CHAR(1 byte),
        CSCODED NUMBER(5), CSACTUAL NUMBER(5), CSOVERRD
        NUMBER(5), ANNMILES NUMBER(6), DLORIGDATE DATE,
        DLLASTDATE DATE, DLMONTHS NUMBER(6), MATUREDSC CHAR(1
        byte), PERSISTDSC CHAR(1 byte), ANNUALMILES_RANGE
        VARCHAR2(25 byte), CEDEDLOSS VARCHAR2(1 byte), CEDEDPOL
        VARCHAR2(1 byte), CEDEDCVG VARCHAR2(1 byte),
        CONSTRAINT TABLE1_PK PRIMARY KEY(POLNUM, POLREN,
        POLSEQ, VEHNUM, CVGCODE)
        USING INDEX 
        TABLESPACE V_INDEX
        STORAGE ( INITIAL 3874816K NEXT 0K MINEXTENTS 1 MAXEXTENTS
        2147483645 PCTINCREASE 0) PCTFREE 10 INITRANS 2 MAXTRANS 255)
        TABLESPACE U_DATA PCTFREE 10 PCTUSED 0 INITRANS 1
        MAXTRANS 255
        STORAGE ( INITIAL 4194304K NEXT 0K MINEXTENTS 1 MAXEXTENTS
        2147483645 PCTINCREASE 0)
        NOLOGGING
        MONITORING;Thank you very much!

    user6053424 wrote:
    Hi,
    I have the following update statement which runs for over 3 hours and updates 215 million rows, is there anyway I can rewrite it so it performs better?
    UPDATE TABLE1 v
    SET closs = (SELECT MIN(slloss)
    FROM TABLE2 l
    WHERE polnum = slpoln
    AND      polren = slrenn
    AND      polseq = slseqn
    AND      vehnum = slvehn
    AND      linecvg = sllcvg);
    Are you trying to perform a correlated update? If so, you can perform something similar to;
    Sample data;
    create table t1 as (
       select 1 id, 10 val from dual union all
       select 1 id, 10 val from dual union all
       select 2 id, 10 val from dual union all
       select 2 id, 10 val from dual union all
       select 2 id, 10 val from dual);
    Table created
    create table t2 as (
       select 1 id, 100 val from dual union all
       select 1 id, 200 val from dual union all
       select 2 id, 500 val from dual union all
       select 2 id, 600 val from dual);
    Table createdThe MERGE will update each row based on the maximum for each ID;
    merge into t1
    using (select id, max(val) max_val
           from t2
           group by id) subq
    on (t1.id = subq.id)
    when matched then update
        set t1.val = subq.max_val;
    Done
    select * from t1;
            ID        VAL
             1        200
             1        200
             2        600
             2        600
             2        600If you want all rows updated to the same value then remove the ID grouping from the subquery and from the ON clause.

  • SSM-AIP 7.0(1) Global Correlation config nightmare!

    Thanks, Cisco, for creating a Management nightmare with your "Global Correlation" option in version 7.0...
    Lets start with the SSM-AIP-20 Management interface...
    We have an OOB Management network, with a single POI into this through a separate PIX515E appliance. Both the ASA5540 AND the SSM-AIP-20 reside on this network.
    The first issue was in Routing, since the ASA sees the Management network as "directly attached", and we ROUTE the traffic through the PIX for updates on the SSM module, we had to add translation entries in the PIX515E for the SSM module (10.x.x.x Management, 172.x.x.x translated).
    This was not a big issue, but here is where the nightmare begins...
    First a note: We have the Management network locked down TIGHT, only a couple of Network Management stations allowed into that network to access these devices.
    I enabled Global Correlation in test mode, but it was "failed" every time it tried to update.. Reading other posts, I created ACL and Static NAT in the PIX515E for these IP's:
    204.15.82.17 (IP listed in the IME Global Correlation update server)
    97.65.135.170 and .137 (from another post in these forums)
    207.15.82.17 (IP found in a trace)
    Still no updates. Looking in the PIX logs, I found "no translation" entries for the following addresses:
    198.133.219.25
    209.107.213.40
    208.90.57.73
    I put these in, and it started updating! FIXED? NOT!
    This morning, it was again failing... Looked in the PIX logs again, and found these:
    77.67.85.33
    77.67.85.9
    Entered them, and the SSM is happy again. How long? Who knows?
    So, now I have NINE holes in my "secure" network, and who knows when Cisco will change or add new IP addresses to this list.
    Cisco, if you are listening - ALL access to/from the Global correlation through a single IP? PLEASE?
    (use the one listed in the IME - 204.15.82.17, for the URL "update-manifests.ironport.com")

    A few of the addresses belong to Cisco (originally ironport.com addresses from the ironport aquisition) and are used as manifest servers to provide the sensor a list of files to download.
    The sensor then downloads those files from Akamai servers. Akamai has a large number of servers across the world. Cisco sends the update to Akamai and they replicate it across their servers. When sensors try to connect to the Akamai server it does a DNS query and by controlling the DNS response it can direct sensors to an Akamai server located nearer to the sensor. This allows for better load balancing, response times, and download speeds.
    However, Akamai has a large number of servers (in the thousands I think) world wide, and you can't predict which server your specific sensor will be directed to.
    Sensor connections to the cisco servers for the manifest (file list) is on port 443, and usually to update-manifests.ironport.com URLs.
    Sensor connections to the Akamai servers for the actual file downloads are on port 80 and usually to updates.ironport.com URLs.
    The above is all based on my limited understanding of how the updates work. I may have gotten a few details wrong, but should at least give you a general idea.
    I will be working with development to get this better documented in Release Notes and Readme with the next IPS software release.

  • Need help with update query

    I am having a strange problem with an update query I am running. Here are the specifics:
    1. I run a script that extracts qualifying rows form a source table (S1), performs some calculation,s and stores the results in a temporary table (T1).
    2. The calculations stored in the temporary table (T1) are only for a subset of rows in the source table (S1).
    3. The temporary table (T1) uses the same primary key values as the source table (T1).
    4. Once the calculations are completed, I want to update a single column on the source table (S1.CalcValue) with the calculated value from the temporary table (T1.CalcValue).
    The problem is that I am doing monthly updates so I run month 1, do some verification of the data and then update the source table. Then repeat the process for months 2 through n. When I run the update for the month 2 data, the prior month 1 data for the column is lost. Below is the update script which looks like it should work and only update on the matching keys between the temporary table (T1) and the source table (S1). I was wondering if anyone could let me know what is wrong with this script and why.
    I am new to Oracle having worked extensively in SQL Server, so the syntax differences are killing me right now so any help would be appreciated.
    Update script:
    procedure update_rvu AS
    BEGIN
    --update the test.RVU table
    update test.RVU S1
    set S1.CalcRVU = ( select
    T1.CalcRVU
    from
    TMP_RVU T1
    where
    S1.GroupId = T1.GroupId
    and
    S1.PatientId = T1.PatientId
    and
    S1.InvoiceId = T1.InvoiceId
    and
    S1.TransId = T1.TransId
    commit;
    END update_rvu;
    Edited by: user9009311 on Apr 14, 2010 4:47 PM

    Most likely you want a WHERE clause in your update portion ... something like
    update test.RVU S1
    set S1.CalcRVU = ( select
    T1.CalcRVU
    from
    TMP_RVU T1
    where
    S1.GroupId = T1.GroupId
    and
    S1.PatientId = T1.PatientId
    and
    S1.InvoiceId = T1.InvoiceId
    and
    S1.TransId = T1.TransId
    where exists
       select null
       from tmp_rvu t11
       where S1.GroupId = T11.GroupId
       and    S1.PatientId = T11.PatientId
       and    S1.InvoiceId = T11.InvoiceId
       and    S1.TransId = T11.TransId
    )You can also look into using the MERGE command (if you're on version 10 or better you can perform update only operations with it). I personally find it more 'friendly' than correlated updates a lot of the time.

  • Multiple Row Update From Similar Table

    I am attempting to update a table based on similar table if the Entry_Type is D and they have the same log_numbers. I have created queries to show me the results I want but am having some difficulities getting the update to happen. I am getting a single-row subquery returns more than one row error, but I would like to update all necessary rows.
    Here is my sql...
    UPDATE V.MASTER
    SET (MODIFIED_BY, ENTRY_TYPE) = (
         SELECT MODIFIED_BY, ENTRY_TYPE
         FROM J.BACK)
         WHERE LOG_NUMBER IN
         (SELECT LOG_NUMBER FROM V.MASTER
         WHERE ENTRY_TYPE <> 'D' AND LOG_NUMBER = ANY
                   (SELECT LOG_NUMBER FROM J.BACK
                   WHERE ENTRY_TYPE = 'D'))
    I would appreciate any assistance! Thanks!

    You can also use correlated update. This one is from AskTom (http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1197999096334)
    if you have the proper primary keys to assure uniqueness on S and C, this does it (i have the keys
    noted in the creates)
    ops$tkyte@ORA920> create table pgp_person
    2 ( date_of_birth date,
    3 update_by varchar2(10),
    4 update_date date,
    5 load_timestamp date,
    6 person_num int );
    Table created.
    ops$tkyte@ORA920>
    ops$tkyte@ORA920> create table ship_passenger
    2 ( date_of_birth date,
    3 person_num int,
    4 voy_num int,
    5 book_num int,
    6 seq_num int,
    7 primary key (person_num) );
    Table created.
    ops$tkyte@ORA920>
    ops$tkyte@ORA920> create table pgp_cruise_history
    2 ( voy_num int,
    3 book_num int,
    4 seq_num int,
    5 matched_ind int,
    6 primary key(voy_num,book_num,seq_num) );
    Table created.
    ops$tkyte@ORA920>
    ops$tkyte@ORA920> update ( select p.date_of_birth dob1, s.date_of_birth dob2,
    2 p.update_by, p.update_date, p.load_timestamp
    3 from pgp_person p, pgp_cruise_history c, ship_passenger s
    4 where p.person_num = s.person_num
    5 and s.voy_num = c.voy_num
    6 and s.book_num = c.book_num
    7 and s.seq_num = c.seq_num
    8 and c.matched_ind is not null
    9 and s.date_of_birth <> p.date_of_birth )
    10 set dob1 = dob2,
    11 update_by = 'sdm18649',
    12 update_date = trunc(sysdate),
    13 load_timestamp = sysdate;
    0 rows updated.

Maybe you are looking for

  • SMARTFORMS: how to link two varibles in one line.

    Hi guys, I am experiencing a problem with SMARTFORMS. I have a string longer than 255 characters. I want to print it in a smartforms, but due to the limitation in the characters I have to separate the string in two strings. My question is the next, h

  • Open movies in quicktime full screen by default

    I've got a question regarding quicktime pro for windows: is it possible to launch movies in full screen by default? The thing is that the movies will be shown on a video wall. The actual computer that is connected to the video wall is mounted directl

  • ITunes Sign In and Genius Wont Connect?

    Hey All, I have a repeating problem about my connection with Genius and signing in? It says there is an error and that I need to check my internet connection to see if it is active? I am using a modem, and I watch it connect right in front of my eyes

  • Installing W7 upgrade in Lion via initial Vista full install

    Hi, all; I am able to get copies of Windows OS's from my school, and since I just got a new Mac with OS X Lion, I wanted to use boot camp to install Windows for my apps that require the Windows OS.  I was told that I would need to first install the V

  • TRANSPORTATION MODULE - 1

    hi, what is the relevance of shipment cost information profile. we are having frieght condition types here in pricing procedure as condition types, then what is the need for giving different condition types in transportation pricing procedure. where