Multiple UPDATE statement in a message

Hi Experts,
Here is a scenario where we need to send multiple UPDATE statements in single message
the structure is as below.
<Table_name> 0..unbounded occurrence
           <action> UPDATE
           <access>
                   <non key fields>
           </access>
           <key>
                   <key fields>
           </key>
in the above case the node <Table_name> would occur multiple times, the issue is only the first occurrence of the update statement is executed, rest of the update statements are ignored.
did my approach is wrong, please help...
thanks.

Bandana,
No your approach is not wrong. But you may need to tweak little bit to get your requirement correctly.
Please follow Raj or Jais reply in this threads:
JDBC Receiver - Multiple rows Update
JDBC receiver multiple records UPDATE
But with this approach it would be multiple calls. If I were you I would write SQL_DML statement to update all at once.
Regards,
---Satish

Similar Messages

  • How do I pass multiple values from a text box to an update statement

    I hope this does not sound to lame. I am trying to update multiple values Like this:
    Code|| Computer Desc || Computer Price || Computer Name
    SEL1 || Apple macbook || 1564 || Apple Macbook Basic
    SEL2 || Dell 630 || 1470 || Dell Latitude
    I want to change all six values at once in one update statement based on the Code, I can't find a good tutorial/example to help me.
    Can anyone point me in the right direction?
    Thanks so much,
    Laura

    You can do conditional updates with decode or case statements e.g.
    SQL> create table t as
      2  select 'SEL1' as code, 'Apple macbook' as comp_desc, 1564 as comp_price, 'Apple Maxbook Basic' as comp_name from dual union
      3  select 'SEL2', 'Dell 630', 1470, 'Dell Latitude' from dual
      4  /
    Table created.
    SQL>
    SQL> update t
      2  set comp_desc = CASE code WHEN 'SEL1' THEN 'Test1' Else 'Test2' END,
      3      comp_price = CASE code WHEN 'SEL1' THEN 1234 Else 2345 END,
      4      comp_name = CASE code WHEN 'SEL1' THEN 'Test1 Name' Else 'Test2 Name' END
      5  /
    2 rows updated.
    SQL>
    SQL> select * from t
      2  /
    CODE COMP_DESC     COMP_PRICE COMP_NAME
    SEL1 Test1               1234 Test1 Name
    SEL2 Test2               2345 Test2 Name
    SQL>

  • How can i use multiple row subquery in update statement

    Hai All
    I using group function in my update statement.. and i need to update more rows so i need to use multiple row
    subquery pls tell me how to use multiple row subquery in update statement
    For example
    while i am using this like this i got an error
    update dail_att set outtime in (select max(r2.ptime) from temp_att where empcode=r2.enpno and
    barcode=r2.cardn and attend_date=r2.pdate group by enpno,pdate,cardn);
    Pls tell me how to use with example
    Thanks & regards
    Srikkanth.M

    Hai Man
    Thanks for ur response Let me clear what i need
    First step Fetch the records as text file and stores into table T1
    and the next step is i have seperated the text using substring and stores in different columns of a table
    There are two shifts 0815 to 1645 and 1200 and 2000
    Here I rep IN and O rep OUT
    Empno date time inout
    001 01-01-10 0815 I
    002 01-01-10 0815 I
    003 01-01-10 0818 I
    001 01-01-10 1100 0
    001 01-01-10 1130 I
    002 01-01-10 1145 0
    002 01-01-10 1215 I
    004 01-01-10 1200 I
    005 01-01-10 1215 I
    004 01-01-10 1315 O
    004 01-01-10 1345 I
    001 01-01-10 1645 0
    002 01-01-10 1715 0
    003 01-01-10 1718 0
    004 01-01-10 2010 0
    005 01-01-10 2015 0
    This is my T1 table i have taken data from text file and stored in this table from this table i need to move data to another table T2
    T2 contains like this
    Empno Intime Intrin Introut Outtime Date
    001 0815 1100 1130 1645 01-01-10
    002 0815 1145 1215 1715 01-01-10
    003 0818 1718 01-01-10
    004 1200 1315 1345 2010 01-01-10
    005 1215 2015 01-01-10
    This what i am trying to do man but i have little bit problems Pls give some solution with good example
    And my coding is
    declare
         emp_code varchar2(25);
    in_time varchar2(25);
    out_time varchar2(25);
    Cursor P1 is
    Select REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
    From temp_att
    group by REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
    ORDER BY enpno,pdate,ptime;
    begin
         for r2 in p1 loop
    declare
    bar_code varchar2(25);
    begin
    select barcode into bar_code from dail_att where empcode=r2.enpno and attend_date=r2.pdate;
    For r3 in (select empcode,empname,barcode,intime,intrin,introut,addin,addout,outtime,attend_date from dail_att)loop
    if r2.inout ='O' then
    update dail_att set outtime =(select max(r2.ptime) from temp_att where empcode=r2.enpno and barcode=r2.cardn and attend_date=r2.pdate group by r2.cardn,r2.enpno,r2.pdate );
    end if;
    end loop;     
    exception
         when no_data_found then
         if r2.inout ='I' then
                   insert into dail_att(barcode,empcode,intime,attend_date)(select r2.cardn,r2.enpno,min(r2.ptime),r2.pdate from temp_att group by r2.cardn,r2.enpno,r2.pdate );
         end if;
    end;
    end loop;
    commit;     
         end;
    Pls tell me what correction i need to do i the update statement i have used a subquery with group function but when i used it will return only one row but my need is to return many rows and i need to use multiple row subquery
    and how can i use it in the update statement
    Thanks In Advance
    Srikkanth.M

  • Problem in UPDATE statement In Multiple Record Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count 0 THEN
    LOOP
    IF :SYSTEM.last_record 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
    :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    As you do a loop over all the records in the block, of course every record is updated.
    Also, what you do is not the way is intended to be used. In general, you base a block on a table,then there is no need at all for writing INSERT's or UPDATE's. Forms also know's then, which records to be updated and which not.

  • Problem In Update Statement In Multiple Record Data Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count <> 0 THEN
    LOOP
    IF :SYSTEM.last_record <> 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
         VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
              :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;These update statements are without where clause, so it will update all records.
    If it is specific to oracle forms then u may get better help at Forms section.

  • ? Q : Photoshop CC won´t update, states it´s a transmission failure (49) "try again" - I´ve tried again at intervals about 8 times, getting same message..

    Photoshop CC won´t update, states it´s a transmission failure (49) "try again" - I´ve tried again at intervals about 8 times, getting same message..
    Anyone have any good ideas/suggestions ? Much appreciated, thanks !

    Malou please see Error downloading Creative Cloud applications - http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html which discusses error 49.

  • Update multiple columns with single update statement..

    HI all,
    i am reading the columns value from different table but i want to update it with signle update statement..
    such as how to update multiple columns (50 columns) of table with single update statement .. is there any sql statement available i know it how to do with pl/sql..

    As I understood, may be this. Here i am updating ename,sal, comm columns all at once.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17/12/1980 12:00:00        800                    20
    SQL> UPDATE emp
      2     SET ename = lower (ename),
      3         sal = sal + 1000,
      4         comm = 100
      5   WHERE empno = 7369;
    1 row updated.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 smith      CLERK           7902 17/12/1980 12:00:00       1800        100         20
    SQL> UPDATE emp
      2     SET ename = (SELECT 'ABCD' FROM DUAL),
      3         sal = (SELECT 1000 FROM DUAL),
      4         comm = (SELECT 100 FROM DUAL)
      5   WHERE empno = 7369;
    1 row updated.

  • Multiple select, update statements in one script

    Hi All,
    I wrote a script that has multiple select, update statements. When I ran the script in the sqlplus, I got error on second update statement:
    ORA-00936: missing expression
    Have any idea what was the problem?
    Thanks
    OF

    the following are my codes:
    set termout off
    set showmode off
    set timing off
    --set echo off
    set echo on
    set heading off
    set verify off
    set pagesize 0
    -- Parameters
    -- Transaction Date
    -- Show dates this format by default
    ALTER SESSION SET nls_date_format='DD-MON-YYYY';
    -- Define bind variables to hold report parameters
    var v_date varchar2(13)
    var v__run_date varchar2(13)
    begin
    -- Get job sumission variable for Transaction Date
    select gjbprun_value into :v_date
    from general.gjbprun
    where gjbprun_job = '&&1'
    and gjbprun_one_up_no = &&2
    AND gjbprun_number = '01' ;
    End;
    spool fwuodoc_&&2
    select FABINVH_CODE, FABINVH_POHD_CODE,
    FABINVH_INVOICE_DATE, FABINVH_PMT_DUE_DATE, FABINVH_TRANS_DATE,
    fabinvh_complete_ind
    from fabinvh
    where fabinvh_complete_ind='R'
    and trunc(FABINVH_TRANS_DATE) < trunc(to_date('&&dd_mon_yyyy','dd-mon-yyyy'))
    update fabinvh set
    fabinvh_trans_date=to_date('&&dd_mon_yyyy','dd-mon-yyyy')
    where fabinvh_complete_ind='R'
    and trunc(FABINVH_TRANS_DATE) < trunc(to_date('&&dd_mon_yyyy','dd-mon-yyyy'))
    update fpbreqh set
    fpbreqh_trans_date=to_date('&&dd_mon_yyyy','dd-mon-yyyy')
    where fpbreqh_complete_ind='Y'
    and nvl(fpbreqh_appr_ind,'x')<>'Y'
    spool off
    exit

  • Update statement for multiple records

    i have table a and table b
    common col in both the tables is emp_id
    in table b i have district_id
    which i want to update in table a.... column district_id for all the employees
    how to write update statement for this
    Edited by: user10873676 on Oct 17, 2011 8:00 AM

    Based on your current description, we have something like this...
    SQL> create table a (emp_id number)
      2  /
    Table created.
    SQL>
    SQL> create table b (emp_id number, district_id number)
      2  /
    Table created.
    SQL>
    SQL> insert into a (emp_id)
      2  select rownum from dual connect by rownum <= 10
      3  /
    10 rows created.
    SQL>
    SQL> insert into b (emp_id, district_id)
      2  select rownum, 10-rownum from dual connect by rownum <= 10
      3  /
    10 rows created.
    SQL>
    SQL> update b
      2  set district_id = 1
      3  /
    10 rows updated.
    SQL>
    SQL> select * from a;
        EMP_ID
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.
    SQL> select * from b;
        EMP_ID DISTRICT_ID
             1           1
             2           1
             3           1
             4           1
             5           1
             6           1
             7           1
             8           1
             9           1
            10           1
    10 rows selected.Which I'm sure is NOT what you want as the update on table b has nothing to do with table a, and we have no idea what the district_id should be updated with.

  • UPDATE statement based on query and return multiple value

    Hi everybody,
    I have two tables: temp3 and temp
    One of them (temp3) should be updated based on the query where clause (id and flag columns).
    I run this query but it updates all of the records in the temp3. I want to update only records with 'UPDATED' flag.
    update temp3 t3
    set (id,name,address) = (select t.id, t.name, t.address from temp t, temp3 t3
    where t.id = t3.id and t.flag = 'UPDATED');
    Does any body know how I can do it?
    I appreciate your help
    Thx

    Hello
    Basically you're missing a where clause on your update statement to restrict rows in t3 to the ones that have a corresponding row in t1.
    SQL> select * from dt_test_t1;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joseph Bloggs        Some street          UPDATED
             1 Joe Bloggs           Old street           OLD
             2 Fredrick Bloggs      New street           UPDATED
             2 Fred Bloggs          Some street          OLD
             3 Robert Bloggs        Better street        UPDATED
             3 Bob Bloggs           Some street          OLD
           100 Barry Bethel         Some street          UPDATED
           200 Giles Brandreth      Some street          UPDATED
    8 rows selected.
    SQL> select * from dt_test_t3;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joe Bloggs           Old street
             2 Fred Bloggs          Some street
             3 Bob Bloggs           Some street
             4 Joe Smith            Some street
             5 John Doe             Some street
    --this update as it stands does not work as it updates rows to have
    --null name and address where there is not a proper matching row in
    --t1
    SQL> UPDATE
      2     dt_test_t3 t3
      3  SET
      4     (       t3.name,
      5             t3.address,
      6             t3.row_status
      7     ) = (SELECT
      8             t1.name,
      9             t1.address,
    10             t1.row_status
    11          FROM
    12             dt_test_t1 t1
    13          WHERE
    14             t1.id = t3.id
    15          AND
    16             t1.row_status = 'UPDATED'
    17         );
    5 rows updated.
    SQL> select * from dt_test_t3;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joseph Bloggs        Some street          UPDATED
             2 Fredrick Bloggs      New street           UPDATED
             3 Robert Bloggs        Better street        UPDATED
    4
    5
    SQL> rollback;
    Rollback complete.
    --Now add in the where clause to make sure we're only updating rows in
    --t3 that have a corresponding row in t1:
    SQL> UPDATE
      2     dt_test_t3 t3
      3  SET
      4     (       t3.name,
      5             t3.address,
      6             t3.row_status
      7     ) = (SELECT
      8             t1.name,
      9             t1.address,
    10             t1.row_status
    11          FROM
    12             dt_test_t1 t1
    13          WHERE
    14             t1.id = t3.id
    15          AND
    16             t1.row_status = 'UPDATED'
    17         )
    18  WHERE
    19     EXISTS( SELECT
    20                     NULL
    21             FROM
    22                     dt_test_t1 t1
    23             WHERE
    24                     t1.id = t3.id
    25             AND
    26                     t1.row_status = 'UPDATED'
    27             );
    3 rows updated.
    SQL> select * from dt_test_t3;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joseph Bloggs        Some street          UPDATED
             2 Fredrick Bloggs      New street           UPDATED
             3 Robert Bloggs        Better street        UPDATED
             4 Joe Smith            Some street
             5 John Doe             Some streetHTH
    David

  • Performance degradation in Update statement

    Hi
    I have a table t1 with 3 of the columns as :- c1 ,c2,c3.
    there is a non unique index on c2 ,c3.
    I am using an update statement as : update t1 set c1="value" where c2="some_value" and c3="some_value2" ;
    this works fine in case the number of rows for the same c2 and c3 are less (~100) but takes a large time when ~30,000.
    And it has to be run many times in my application (time out is occuring now)
    Can anybody suggest a solution ?
    Thanks
    Message was edited by:
    user580975

    First off, setting a table to NOLOGGING does not affect the rate of redo generation unless you are also doing direct-path inserts (which is obviously not the case here and which come with their own set of issues). Note that the amount of redo being generated in these two examples is quite similar.
    SCOTT @ jcave102 Local> create table all_obj_cpy as select * from all_objects;
    Table created.
    Elapsed: 00:00:10.78
    SCOTT @ jcave102 Local> set autotrace traceonly;
    SCOTT @ jcave102 Local> alter table all_obj_cpy logging;
    Table altered.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> update all_obj_cpy
      2  set last_ddl_time = sysdate - 1;
    42511 rows updated.
    Elapsed: 00:00:01.45
    Execution Plan
    Plan hash value: 1645016300
    | Id  | Operation          | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT   |             | 43776 |   384K|   137   (3)| 00:00:02 |
    |   1 |  UPDATE            | ALL_OBJ_CPY |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| ALL_OBJ_CPY | 43776 |   384K|   137   (3)| 00:00:02 |
    Note
       - dynamic sampling used for this statement
    Statistics
            556  recursive calls
          46075  db block gets
           1558  consistent gets
              0  physical reads
       13575764  redo size
            924  bytes sent via SQL*Net to client
            965  bytes received via SQL*Net from client
              6  SQL*Net roundtrips to/from client
              6  sorts (memory)
              0  sorts (disk)
          42511  rows processed
    SCOTT @ jcave102 Local> alter table all_obj_cpy nologging;
    Table altered.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> update all_obj_cpy
      2  set last_ddl_time = sysdate - 2;
    42511 rows updated.
    Elapsed: 00:00:01.32
    Execution Plan
    Plan hash value: 1645016300
    | Id  | Operation          | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT   |             | 43776 |   384K|   137   (3)| 00:00:02 |
    |   1 |  UPDATE            | ALL_OBJ_CPY |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| ALL_OBJ_CPY | 43776 |   384K|   137   (3)| 00:00:02 |
    Note
       - dynamic sampling used for this statement
    Statistics
            561  recursive calls
          44949  db block gets
           1496  consistent gets
              0  physical reads
       12799600  redo size
            924  bytes sent via SQL*Net to client
            965  bytes received via SQL*Net from client
              6  SQL*Net roundtrips to/from client
              6  sorts (memory)
              0  sorts (disk)
          42511  rows processedSecond, if you did manage to do an unlogged operation, make absolutely certain you understand the recovery implications. You must do a complete backup of the database after an unlogged operation or the table will not be recovered in the event of a database failure. If you have a standby database for disaster recovery, unlogged operations would cause the standby to be useless (hence the option to force logging at the tablespace and/or database level).
    While it's certainly possible that this is an Oracle server configuration problem, it would be relatively tough to configure a system so that a 30,000 row update would force excessive log switches. If it were a configuration problem, you'd expect that any update of 30,000 rows would be slow and that multiple sessions running smaller updates would also be slow, but I don't believe that describes the symptoms the original poster is concerned about.
    Justin

  • Sudden increase in buffer gets per executions in update statement

    Hi,
    Recently we have encountered one performance issue, which is most likely caused by a sudden increase in the buffer gets per execution.
    The SQL is an update statement, updating a table using a primary key (we have checked to confirm the running execution plan is using the primary key), and one field being updated is a BLOB column.
    As shown in the below statistics, there is no major change in the number of executions during the every 20 minutes monitoring interval. However, the buffer gets per executions has been more than double, and the CPU time is almost doubled, hence the exec_time (elapsed time) has been doubled.
    The same SQL has been running for the past four years in multiple similar databases. The database is Oracle 9.2.0.4 running on Solaris 9. For the past 300 days, the average elapsed time per execution is about 0.0093s, while the average buffer gets per execution is about 670. The update statement has been executed about 9 times per second.
    The question is why there is a sudden increase in the buffer gets? The sudden increase happened twice for the past two days.
    <pre>
    B_TIME E_TIME EXECUTIONS_DIFF EXEC_TIME CPU_TIME BUFFER_GETS EXEC_PER_DAY
    2009-11-25-14:04 2009-11-25-14:23 8513 .0069 .0068 315.56 646329
    2009-11-25-14:23 2009-11-25-14:43 10170 .007 .0068 312.28 726188
    2009-11-25-14:43 2009-11-25-15:05 11873 .0072 .0069 320.17 787885
    2009-11-25-15:05 2009-11-25-15:23 8633 .011 .0101 844.83 675014
    2009-11-25-15:23 2009-11-25-15:44 9668 .0144 .0137 1448.51 680778
    2009-11-25-15:44 2009-11-25-16:04 9671 .0163 .0156 1809.04 702163
    2009-11-25-16:04 2009-11-25-16:25 10260 .0188 .0177 2107.67 711447
    2009-11-25-16:25 2009-11-25-16:44 9827 .0157 .0151 1834.3 739593
    2009-11-25-16:44 2009-11-25-17:05 10586 .0171 .0164 2008.25 714555
    2009-11-26-08:04 2009-11-26-08:24 11028 .0182 .0172 1979.61 800688
    2009-11-26-08:24 2009-11-26-08:44 10533 .0154 .0149 1734.62 750248
    2009-11-26-08:44 2009-11-26-09:04 9367 .018 .0168 2043.95 685274
    2009-11-26-09:04 2009-11-26-09:24 10307 .0214 .0201 2552.43 729938
    2009-11-26-09:24 2009-11-26-09:45 10932 .0251 .0234 3111.48 762328
    2009-11-26-09:45 2009-11-26-10:05 10992 .0278 .0254 3386.41 797404
    2009-11-26-15:03 2009-11-26-15:16 7183 .0425 .0348 4615.42 746824
    2009-11-26-15:16 2009-11-26-15:23 2921 .0417 .0373 4887.75 682092
    2009-11-26-15:23 2009-11-26-15:43 9597 .0393 .0352 4603.62 679656
    2009-11-26-15:43 2009-11-26-16:03 8797 .0411 .0362 4783.66 630755
    2009-11-26-16:03 2009-11-26-16:23 9957 .0453 .0391 5168.28 718100
    2009-11-26-16:23 2009-11-26-16:43 11209 .0436 .0369 4870.77 808395
    2009-11-26-16:43 2009-11-26-17:03 10729 .0428 .0375 5119.56 766103
    2009-11-26-17:03 2009-11-26-17:23 9116 .0409 .0363 4912.58 659098
    </pre>
    Yesterday I did a trace on one of the sessions running the update statement, and below is the tkprof output:
    <pre>
    call count cpu elapsed disk query current rows
    Parse 76 0.03 0.00 0 0 0 0
    Execute 76 4.58 5.14 0 567843 19034 76
    Fetch 0 0.00 0.00 0 0 0 0
    total 152 4.61 5.14 0 567843 19034 76
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 88
    Rows Row Source Operation
    1 UPDATE (cr=30 r=0 w=0 time=6232 us)
    1 INDEX UNIQUE SCAN <PK Index Name> (cr=3 r=0 w=0 time=58 us)(object id 81122)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    Waited--------------------------------------------------------------------------------
    SQL*Net message to client 152 0.00 0.00
    SQL*Net message from client 152 0.00 0.22
    SQL*Net more data from client 1894 0.00 0.03
    SQL*Net break/reset to client 152 0.00 0.00
    buffer busy waits 14 0.00 0.00
    enqueue 1 0.61 0.61
    </pre>
    GaoYuan

    Hi,
    I've reformatted your output for better understanding (with {noformat}...{noformat}):
    B_TIME           E_TIME           EXECUTIONS_DIFF  EXEC_TIME   CPU_TIME BUFFER_GETS EXEC_PER_DAY
    2009-11-25-14:04 2009-11-25-14:23            8513      .0069      .0068      315.56       646329
    2009-11-25-14:23 2009-11-25-14:43           10170       .007      .0068      312.28       726188
    2009-11-25-14:43 2009-11-25-15:05           11873      .0072      .0069      320.17       787885
    2009-11-25-15:05 2009-11-25-15:23            8633       .011      .0101      844.83       675014
    2009-11-25-15:23 2009-11-25-15:44            9668      .0144      .0137     1448.51       680778
    2009-11-25-15:44 2009-11-25-16:04            9671      .0163      .0156     1809.04       702163
    2009-11-25-16:04 2009-11-25-16:25           10260      .0188      .0177     2107.67       711447
    2009-11-25-16:25 2009-11-25-16:44            9827      .0157      .0151      1834.3       739593
    2009-11-25-16:44 2009-11-25-17:05           10586      .0171      .0164     2008.25       714555
    2009-11-26-08:04 2009-11-26-08:24           11028      .0182      .0172     1979.61       800688
    2009-11-26-08:24 2009-11-26-08:44           10533      .0154      .0149     1734.62       750248
    2009-11-26-08:44 2009-11-26-09:04            9367       .018      .0168     2043.95       685274
    2009-11-26-09:04 2009-11-26-09:24           10307      .0214      .0201     2552.43       729938
    2009-11-26-09:24 2009-11-26-09:45           10932      .0251      .0234     3111.48       762328
    2009-11-26-09:45 2009-11-26-10:05           10992      .0278      .0254     3386.41       797404
    2009-11-26-15:03 2009-11-26-15:16            7183      .0425      .0348     4615.42       746824
    2009-11-26-15:16 2009-11-26-15:23            2921      .0417      .0373     4887.75       682092
    2009-11-26-15:23 2009-11-26-15:43            9597      .0393      .0352     4603.62       679656
    2009-11-26-15:43 2009-11-26-16:03            8797      .0411      .0362     4783.66       630755
    2009-11-26-16:03 2009-11-26-16:23            9957      .0453      .0391     5168.28       718100
    2009-11-26-16:23 2009-11-26-16:43           11209      .0436      .0369     4870.77       808395
    2009-11-26-16:43 2009-11-26-17:03           10729      .0428      .0375     5119.56       766103
    2009-11-26-17:03 2009-11-26-17:23            9116      .0409      .0363     4912.58       659098
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       76      0.03       0.00          0          0          0           0
    Execute     76      4.58       5.14          0     567843      19034          76
    Fetch        0      0.00       0.00          0          0          0           0
    total      152      4.61       5.14          0     567843      19034          76
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 88
    Rows     Row Source Operation
          1  UPDATE  (cr=30 r=0 w=0 time=6232 us)
          1   INDEX UNIQUE SCAN <PK Index Name(cr=3 r=0 w=0 time=58 us)(object id 81122)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      SQL*Net message to client                     152        0.00          0.00
      SQL*Net message from client                   152        0.00          0.22
      SQL*Net more data from client                1894        0.00          0.03
      SQL*Net break/reset to client                 152        0.00          0.00
      buffer busy waits                              14        0.00          0.00
      enqueue                                         1        0.61          0.61
    ********************************************************************************Can you please provide a DDL for the table, indexes, type of the tablespace(s) they reside in (ASSM/MSSM, extents sizes), the UPDATE statement, how many sessions on average/peaks are doing the same thing concurrently, how many sessions are working this table concurrently and how do they use it?

  • LogicalDeletePollingStrategy adapter running multiple updates and using CPU

    We have multiple SOA processes that poll tables in a database with a Logical delete polling strategy. After polling the table the db adapter does an update to flag the record as read.
    We have a production database and test database for the source system, and production and test SOA 11.1.1.4 systems. After cloning our production database to our test database, I will see the update statement for the adapter running multiple times in the test database. However, their are no records in the table that meet the criteria for the polling.
    The polling frequency is every 10 minutes, and if the update statement did anything it would take less than 1 second. However I will see 5-10 copies of the update statement running and using resources.
    Has anyone seen a db apapter do this?

    maybe unit of order and unit of work can help you on that, though i haven't any experience on both topics :
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/uow.html
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/uoo.html
    or the mediator supports some sort of sequencer, see : http://www.xenta.nl/blog/2010/05/14/oracle-soa-suite-11g-resequence-messages-in-mediator/

  • Trying to convert an update statement with an "in" to Ibatis sql

    Here is the basic sql:
    update photo_links set pl_viewed = VIEWED
        where pl_receiver = RECEIVER_ID
        and pl_photo_id in (SELECT ph_photo_id FROM photos WHERE ph_photo_album_id = PHOTO_ALBUM_ID)Here is what I have so far:
      <update id="updatePhotoAlbumToViewed" parameterMap="com.db.model.PhotoLinks">
        update photo_links set pl_viewed = #pl_viewed:TINYINT#
             where pl_receiver = #pl_receiver#
                  and pl_photo_id in
      </update>
      <select id="selectPhotosInAlbum" parameterClass="java.lang.Long" resultClass="java.util.ArrayList">
         SELECT ph_photo_id FROM photos WHERE ph_photo_album_id = #value#
      </select>Heres my question:
    How can I pass more than one typed parameter (i.e. com.db.model.PhotoLinks and java.lang.Long) so that I could combined these to together. I have been trying to see how IN statements are used in Ibatis but its a hard word to search for because the word "in" is so common. Perhaps I am totally missing something. Any help is welcome!

    The way your update is written, it should update all rows in messages. The subquery is failing because of the equality operator. = requires only one value; SQL does not know what to do with multiple values so it raises an error when the query finds more than one row. Also, you are doing an uncorrelated subquery; these can be very, very slow when you are updating large amounts of data.
    You have a couple of options. Which one you use depends on what you want to do. If you can perform a correlated update by using a value from your messages table in the subquery that should provide good perfomance provided the correlation column in indexed in the lookup tables. Otherwise you can put the subquery as an outer query and do the update inside the loop - this is sometimes faster than an update with an uncorrelated subquery, something like
    for record in cursor loop
      update table
        set column - record.value
      where key = record.key;
    end loop;

  • Decode function in Update statement

    Hello everyone,
    I'm trying to write a query where I can update a pastdue_fees column in a book_trans table based on a difference between return_dte and due_dte columns.
    I am using Oracle SQL. This is what I have so far for my decode function:
    SQL> SELECT
    2 DECODE(SIGN((return_dte - due_dte)*2),
    3 '-1', '0',
    4 '1', '12', 'Null')
    5 FROM book_trans;
    DECO
    Null
    12
    Null
    0
    So the logic is that if the sign is -1, the value in return_dte column should be 0; if it's +1 then it's 12 and everything else is Null.
    So now, I need to enter my decode function into the update statement to update the columns. However, I get error messages.
    The logic should be:
    UPDATE book_trans SET PastDue_fees = decode(expression)
    I've given it a couple of different tries with the following results:
    SQL> UPDATE book_trans
    2 SET pastdue_fees = SELECT
    3 DECODE(SIGN((return_dte - due_dte)*2),
    4 '-1', '0',
    5 '1', '12', 'Null')
    6 FROM book_trans;
    SET pastdue_fees = SELECT
    ERROR at line 2:
    ORA-00936: missing expression
    SQL> UPDATE book_trans
    2 SET pastdue_fees =
    3 DECODE(SIGN((return_dte - due_dte)*2),
    4 '-1', '0',
    5 '1', '12', 'Null')
    6 FROM book_trans;
    FROM book_trans
    ERROR at line 6:
    ORA-00933: SQL command not properly ended
    Any help or tips would be greatly appreciated as I've been taking SQL for about six weeks and not very proficient!
    Thanks!

    882300 wrote:
    Hello everyone,
    I'm trying to write a query where I can update a pastdue_fees column in a book_trans table based on a difference between return_dte and due_dte columns.
    I am using Oracle SQL. This is what I have so far for my decode function:
    SQL> SELECT
    2 DECODE(SIGN((return_dte - due_dte)*2),
    3 '-1', '0',
    4 '1', '12', 'Null')
    5 FROM book_trans;
    DECO
    Null
    12
    Null
    0
    So the logic is that if the sign is -1, the value in return_dte column should be 0; if it's +1 then it's 12 and everything else is Null.
    So now, I need to enter my decode function into the update statement to update the columns. However, I get error messages.
    The logic should be:
    UPDATE book_trans SET PastDue_fees = decode(expression)
    I've given it a couple of different tries with the following results:
    SQL> UPDATE book_trans
    2 SET pastdue_fees = SELECT
    3 DECODE(SIGN((return_dte - due_dte)*2),
    4 '-1', '0',
    5 '1', '12', 'Null')
    6 FROM book_trans;
    SET pastdue_fees = SELECT
    ERROR at line 2:
    ORA-00936: missing expression
    SQL> UPDATE book_trans
    2 SET pastdue_fees =
    3 DECODE(SIGN((return_dte - due_dte)*2),
    4 '-1', '0',
    5 '1', '12', 'Null')
    6 FROM book_trans;
    FROM book_trans
    ERROR at line 6:
    ORA-00933: SQL command not properly ended
    Any help or tips would be greatly appreciated as I've been taking SQL for about six weeks and not very proficient!
    Thanks!If you really really really want to update the entire table, the syntax would be...
    UPDATE book_trans
       SET
          pastdue_fees  = DECODE(SIGN((return_dte - due_dte)*2), -1, 0, 1, 12, Null);I took out all the single quotes. If you actually have a string column and you're storing entirely numbers in it then it should be declared as a NUMBER column and not a character (varchar2) column.
    ALWAYS use the proper data type, it'll save you a ton of headaches in the future.
    Also, since you're new to the forum, please read the FAQ so you learn the etiquette and what not.
    http://wikis.sun.com/display/Forums/Forums+FAQ

Maybe you are looking for

  • Firewall/nat/routing issue

    I am not able to setup a firwall box which will transmit internet packets from internal network to the internet and otherway. Could you please guide me what i am missing here and where I am going wrong? [internet] ----(public ip)---[cable modem]( 192

  • How to create several youtubeclips in different videocontainers

    Hi guys, i'm new in edge and in this forum: I've read all the discussion about create several youtube clips in a single container : http://forums.adobe.com/message/4722007#4722007 What i need to do is to have diffrent containers in the same page with

  • Opening a link in a new tab brings opens to a page of Chinese writing

    I have had several web sites today that have re-routed me to a page filled with Chinese. The location bar shows the correct destination, but it brings up chinese on an otherwise blank page. The page I selected to view was at this URL: http://www.expo

  • Internal Order Budget amount stuck in Commitment

    Hi, We have reversed the GR and reduce the PO amount but the amount is still stuck as committed item. I used program in the past to reorganize \ restructure the amount but I forgot that program and I couldn't find out anything. Can anyone please let

  • Communication Channel Strange Behaviour

    Hi, We are facing a strange behaviour with communication channel monitoring in RWB for JMS Adapter. I am sending data from IDoc to JMS. Message is processed successfully inside Integration Engine of PI.Message monitoring in RWB shows status successfu