Need a help on Update statement

Hi All,
I Need a help in updating a table column. PFB my requirement.
Table1
ItemID OrgId       Date
1       82     12/sep/2012   
2       82     25/oct/2012
3       82     17/Nov/2012
4     82     22/Jan/2013
5     82     26/sep/2012
Table2
Itemid     orgid       Date1
1      82     23/sep/2012      
2      82     25/Dec/2012
3      82     17/Sep/2012
4      82     22/Feb/2013
5      82     26/Oct/2012
Table3
Itemid     orgid       Date3
1      82     10/sep/2012      
7      82     30/Dec/2012
3      82     12/Sep/2012
10      82     27/Feb/2013
5      82     29/Oct/2012
I Need to Update Date column of Table1 With Date3 of table3
If
Item and org combination is present in table3 and date column of table1 is less than Date3 of table3
Else
I need to Update with date2 of table2.Can we acheive this in a single update statement, can any one help me on this.
Thanks and regards,
Rakesh
Edited by: Venkat Rakesh on Sep 27, 2012 11:04 PM

You can probably also use MERGE:
--DROP TABLE table1;
--DROP TABLE table2;
--DROP TABLE table3;
ALTER SESSION SET nls_language = 'AMERICAN';
CREATE TABLE table1
   itemid    CHAR (1),
   orgid     CHAR (2),
   thedate   DATE
INSERT INTO table1   SELECT '1', '82', TO_DATE ('10/sep/2011', 'dd/mon/yyyy') FROM DUAL;
INSERT INTO table1   SELECT '2', '82', TO_DATE ('10/oct/2011', 'dd/mon/yyyy') FROM DUAL;
INSERT INTO table1   SELECT '3', '82', TO_DATE ('10/nov/2011', 'dd/mon/yyyy') FROM DUAL;
INSERT INTO table1   SELECT '4', '82', TO_DATE ('10/jan/2011', 'dd/mon/yyyy') FROM DUAL;
INSERT INTO table1   SELECT '5', '82', TO_DATE ('10/sep/2011', 'dd/mon/yyyy') FROM DUAL;-- won't be updated
CREATE TABLE table2
   itemid    CHAR (1),
   orgid     CHAR (2),
   thedate   DATE
INSERT INTO table2   SELECT '1', '82', TO_DATE ('01/sep/2012', 'dd/mon/yyyy') FROM DUAL;
INSERT INTO table2   SELECT '2', '82', TO_DATE ('01/dec/2012', 'dd/mon/yyyy') FROM DUAL;
INSERT INTO table2   SELECT '3', '82', TO_DATE ('01/sep/2012', 'dd/mon/yyyy') FROM DUAL;
INSERT INTO table2   SELECT '4', '82', TO_DATE ('01/feb/2012', 'dd/mon/yyyy') FROM DUAL;
CREATE TABLE table3
   itemid    CHAR (1),
   orgid     CHAR (2),
   thedate   DATE
INSERT INTO table3   SELECT '2', '82', TO_DATE ('30/dec/2009', 'dd/mon/yyyy') FROM DUAL; -- date less than table1, so picks from table2
INSERT INTO table3   SELECT '4', '82', TO_DATE ('30/mar/2013', 'dd/mon/yyyy') FROM DUAL; -- larger than table1 , so pick this date
-- table1 original data
SELECT * FROM table1;
-- merge new data
MERGE INTO table1
     USING (SELECT NVL (t1.itemid, t2.itemid) itemid,
                   NVL (t1.orgid, t2.orgid) orgid,
                   t2.thedate prefdate ,
                   t1.thedate nextdate
              FROM    table2 t1
                   FULL OUTER JOIN
                      table3 t2
                   ON t1.itemid = t2.itemid AND t1.orgid = t2.orgid) dat
        ON (dat.itemid = table1.itemid AND dat.orgid = table1.orgid)
WHEN MATCHED
THEN
   UPDATE SET table1.thedate = (case when prefdate > table1.thedate then prefdate else nextdate end) ;
--table1 updated data
SELECT * FROM table1;OUTPUT:
Session altered.
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
Table created.
1 row created.
1 row created.
ITEMID ORGID THEDATE  
1      82    10.09.2011
2      82    10.10.2011
3      82    10.11.2011
4      82    10.01.2011
5      82    10.09.2011
5 rows selected.
4 rows merged.
ITEMID ORGID THEDATE  
1      82    01.09.2012
2      82    01.12.2012
3      82    01.09.2012
4      82    30.03.2013
5      82    10.09.2011
5 rows selected.

Similar Messages

  • Help on update statement in Apply DML Handler

    I followed the example given in Streams document.
    The document has the code for converting DELETE on the source to INSERT on the target. I added the dml handler code INSERT and UPDATE statements also.
    In DELETE, INSERT, UPDATE dml handler code, I am setting the command type to 'INSERT' so that I can insert the data in the target table.
    It is working fine for DELETE and INSERT statements.
    When I do update on the source table,
    I see only the value for the column I updated and all other columns are showing blank. May be this is the normal behaviour. How do I see the values for entire record. Do I need to join the source table based on the key column to get the data for the columns that were not updated.
    Also, I thought I should at least see the values for key column and updated column in the target table. It only shows the value for updated column but not for key column. But, When I choosed the old values (I know we need new values, but I just did it for test purpose) in the UPDATE DML handler, it shows the values for key column and the updated column.
    When I read the data in the LCR record using get_value('old', 'EMPLOYEE_ID') and get_value('NEW', 'FIRST_NAME')
    for key column, it shows the value in both old and new. I do not understand why it is not inserting the key column value in the target table.
    Thanks for your help in advance.
    Best regards,

    I forgot to mention these things.
    We added supplmental logging using alter database add supplemental log data (primary key, unique index) columns;
    I also added the supplemental logging on the source key column (employee_id) using ALTER TABLE emp ADD SUPPLEMENTAL LOG GROUP log_group_emp_pk (employee_id) ALWAYS;
    I also set the key column on the target table using DBMS_APPLY_ADM.SET_KEY_COLUMNS.
    Thanks for your help in advance.
    Best regards,

  • Help in Update Statement

    Hi All,
    I would like to create an update statement which produces the desired result(below) but find that the update statement I have created does not perform.
    <pre>
    CREATE TABLE RACE(
    S_ID NUMBER,
    D_PID VARCHAR2(15),
    OCCURENCE NUMBER);
    </pre>
    <pre>
    insert into RACE
    values(1,'HYD01',null);
    insert into RACE
    values(2,'HYD01',null);
    insert into RACE
    values(3,'HYD01',null);
    insert into RACE
    values(4,'HYD02',null);
    insert into RACE
    values(5,'HYD02',null);
    insert into RACE
    values(6,'HYD03',null);
    </pre>
    <pre>
    CREATE TABLE RACE_LOOKUP_CNT AS
    select d_pid,count(s_id)occurence
    from race
    GROUP BY d_pid;
    </pre>
    --Need to update the RACE table as
    S_ID DPID OCCURENCE
    1 HYD01 3
    2 HYD01 3
    3 HYD01 3
    4 HYD02 2
    5 HYD02 2
    6 HYD03 1
    Tried this subquery but kept getting multiple rows update.
    <pre>
    update RACE c
    set
    c.occurence = (
    select (a.occurence)
    from RACE_LOOKUP_CNT a
    where a.occurence in
    select occurence
    from RACE b
    AND a.d_pid =c.d_pid);
    </pre>
    Thank you all.

    -Closed-

  • I NEED SOME HELP WITH UPDATING MY IPOD TOUCH PLEASE

    i need some help with my ipod the version is 3.1.3 and every time I'm trying to update it says it can not be restored then it says unknown error so i need some help updating my ipod to version 4.2

    If you mean you're trying to update your ios go to settings/general/software update. then you should see the latest ios just tap it and it will automatically update your ipod. If you're trying to restore your ipod (as it's not quite clear in your query) try doing it through itunes instead of on the device itself

  • Please i need a help in updating my nokia 5800

    Hello everybody
    please I need a help
    when i am updating my nokia in to v40 from v21 using nokia update software it begins downloading but when it reaches 20 mb it returns a lot of times at last it said you have a low internet connectivity
    otherwise when i enter *#0000# and check for updates they said no updates are found
    what is the solution of my problems I have still try updating for more than 5  days but nothing has been changed.
    Can a body upload the update in others serves espically in mediafire sinnce mediafire is the best site for me to download from? please I need the update since my nokia now is slow and after update it will have new things and ofcourse will be speed up.
    please can anyone upload it using www.mediafire.com and thanks so much
    I want it quickly, and only mediafire for downloading working on my bad internet connectivity

    For performing a firmware update you need an high speed internet connection i dont know whats the speed of internet connection you are using, in this case you can go to nokia care point and get it updated. Thats safe and you won't brick your phone too. Firmware updates can be done only through nokia software updater application and through the phone(fota)by the end user and there is no way to put the update file to some place or server like what you asked for.
    If a reply has solved your problem click Accept as solution button, doing it will help others know the solution. Thanks.

  • 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

  • Need some help on updating the KDE wiki page (for KDE 4.4)

    Could somebody help on updating it ? Especially for deprecated sections.
    Thank you very much.

    You have a significant number of code errors (65) which makes trouble shooting layout issues nearly impossible.
    [Invalid] Markup Validation of http://www.getouttohunterdon.com/Things%20to%20Do%20in%20Hunterdon.html - W3C …
    Also, DO NOT USE SPACES in file or folder names. They are invalid in HTML5 and on the web, spaces are converted to %20 characters which can lead to link errors. Use DW's Files Panel (F2) to rename your files without spaces.  You can use underscores_ hyphens- or dots. but no other special characters.  Allow DW to update links for you.  Then fix the remaining code errors. If that doesn't resolve your layout issues, post back with your cleaned up page and we'll take another look at it.
    Nancy O.

  • Need help with update statement with multiple joins

    I've got the following select statement that is pulling 29 records:
    SELECT
    PPA.PROJECT_ID,
    PPA.SEGMENT1,
    peia.expenditure_item_id,
    peia.expenditure_type,
    pec.expenditure_comment
    FROM PA.PA_PROJECTS_ALL PPA,
    pa.pa_expenditure_items_all peia,
    pa.pa_expenditure_comments pec
    where PPA.segment1 < '2008' and
    PPA.project_id = 52 and -- just run for project # 20077119 for testing
    peia.expenditure_type = 'PAYROLL' and
    peia.project_id = ppa.project_id and
    PEC.EXPENDITURE_ITEM_ID = PEIA.EXPENDITURE_ITEM_ID;
    I need to update the pec.expenditure_comments to a static field for those 29 records. I assume I should start with the following, but not sure how to complete the where:
    update
    pa.pa_expenditure_comments pec
    set pec.expenditure_comment = 'REFERENCE HD#728'
    where
    First time that we've ever needed to update, so any and all help appreciated.

    Try using exists:
    update pa.pa_expenditure_comments pec
    set    pec.expenditure_comment = 'REFERENCE HD#728'
    where exists ( select null
                   from   pa.pa_projects_all ppa
                   ,      pa.pa_expenditure_items_all peia
                   ,      pa.pa_expenditure_comments pec2
                   where  ppa.segment1 < ''    -- not sure what you posted here, so for next time:
                                               -- please put your examples between the code tags.
                   and    ppa.project_id = 52  -- just run for project # 20077119 for testing
                   and    peia.expenditure_type = 'PAYROLL'
                   and    peia.project_id = ppa.project_id
                   and    pec2.expenditure_item_id = peia.expenditure_item_id
                   and    pec2.expenditure_item_id = pec.expenditure_item_id
                 );

  • Need help in update statement

    hi,
    how can i achieve the following logic
    I have table ABC with column A varchar(20), B(int), C(varchar(20))
    if A is null and B is valid number then C has to be updated with 'text'
    if A is valid text and B is null then C has to be updated with 'number'
    if A is valid text and B is valid number then C has to be updated with 'text-number'
    thanks in advance

    First Update
    UPDATE ABC
    SET C= 'text'
    where A is null;since B is int data type it will always storeintegeres hence check not required.
    Second Update
    UPDATE ABC
    set C = 'number'
    where A is not null
    and B IS NULLThird Update
    UPDATE ABC
    SET C = 'number-text'
    WHERE A IS NOT NULL;Hope this answers.
    You can get this in single update too
    AND B IS NOT NULL

  • Need a help to update coherence cache values in c++

    Hi,
    I need to update coherence cache value of a particular object.
    Managed<ExposureHolderContract>::Handle contract =
    cast<Managed<ExposureHolderContract>::Handle>(cache->get(vsName));
    contract->setName("dsafd");
    When i try to cast to a ManagedObject:: Handle it says
    coherence::lang::ConstCastException: attempt to cast from a "const coherence::lang::Managed<ExposureHolderContract>" to a "coherence::lang::Managed<ExposureHolderContract>"
    at void coherence::lang::coh_throw_const_cast(const std::type_info&, const std::type_info&)(ConstCastException.cpp:27)
    at coherence::lang::coh_throw_const_cast(std::type_info const&, std::type_info const&)
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    <stack frame symbol unavailable>
    at __libc_start_main
    on thread "main"
    In the documentation it says in order to call non static methods we need to retrieve the handle.
    but when I try to cast to a handle it fails.
    I'm inserting data to coherence cache by calling Managed::create method. Is this method making immutable object.
    ExposureHolderContract tempEhc(contractId, name, date, age, weight);
    Managed<ExposureHolderContract>::Handle ss = Managed<ExposureHolderContract>::create(tempEhc);
    cache->put(String::create(contractId.c_str()), ss);
    Please help me to update the recorde value.
    regards,
    sura

    Hi Sura,
    It is a matter of safety and correctness. The in-process caches return a locally held object, and thus if you made some change to it, that change would be visible within the in-process cache, while not visible to the remote cache. Thus future access to the in-process cache would see a value which does not actually exist in the remote cache. While it is true that if you modify it with the intent to immediately re-insert it this shrinks the window of incorrectness that window still exists, and of course the cache has no idea if you will ever reinsert the value. As for the effect on performance it should be insignificant if you actually do put it back in the cache as the cost of a cache update will easily be multiple orders of magnitude greater then the cost of the clone. Also remember there is no requirement to clone a value if you don't intend to mutate it, you can safely use it via the View. So the only time the performance cost of the clone could be considered significant is when you intend to mutate but not reinsert the data, but a clone is also necessary there as not cloning it would leave the in-process cache in an inconsistent state with respect to the remote cache.
    Mark
    Oracle Coherence

  • Help on update statement

    Hi, Please help me on the following update scenario
    I have a column in a table PRD_NM which is a not null column.. I want to update this column with a set of values from another query..
    UPDATE Table1 tg
    set PRD_NM=(select PRD_NM from( select prd_nm,state,item_no,bar_code from products) sr
    where tg.state=sr.state and tg.item_no=sr.item_no and tg.bar_code=sr.bar_code
    and tg.PRD_NM='NA')
    basically i want to update all those PRD_NM with value 'NA' to the value coming from the source query...
    but when I run the statement I am getting an error saying that the PRD_NM cannot be set to null... But here I am not considering anything that can be a null when updated.
    Please help with any idea...
    Edited by: user626688 on Jan 21, 2009 11:18 AM

    Hi,
    If you can't UPDATE via an in-line view (as Someoneelse suggested), and you don't want to basically do the same query twice (once in the scalar sub-query, then again in an EXISTS subquery, as in Someoneelse's next to last message), you can use MERGE:
    MERGE INTO     Table1     tg
    USING     (     SELECT     prd_nm, state, item_no, bar_code
              FROM     products
         )          sr
    ON     (     tg.state     = sr.state
         AND     tg.item_no     = sr.item_no
         AND     tg.bar_code     = sr.bar_code
         AND     tg.PRD_NM     = 'NA'
    WHEN MATCHED THEN
         UPDATE     SET     tg.prd_nm     = sr.prd_nm;Without copies of your tables and data, I can't test.

  • I need some help with updating my MUVO

    Hi guys! I have gb muvo 200. At the moment the veersion of my firm ware is . 02. 0. I want to uggade it to a newer one (_05_02). I downloaded it but when I start it it says put you mp3 player in reocvery mode. I knew how to do that and I did it. But then when I sart the program is does not find my player! It is just searching for ages! So I cant update it((((((((((((((( Help please!)

    Here's a step-by-step list of what to do to upgrade your player. Let me know which steps fail and why.
    Download and install latest drivers file.</LI>
    Download latest firmware for V200.</LI>
    Press and hold Play button on V200 and then connect it to your USB port.</LI>
    Run through Add Hardware Wizard (use Find Automatically method) to setup drivers for Recovery Mode.</LI>
    Run firmware installer program.</LI>
    PB

  • Need urgent help with update!

    hi
    i tried to update my ipod vid to software v1.2 from itunes and i get a message saying
    'The ipod could not be updated. an unknown error occured (1417)'
    so i figured if i restored my ipod that would fix the problem, well i cant seem to restore it either.
    If i attempt to restore it i get an identical message except it has 1428 at teh end instead of 1417.
    Also before i get the error message a box appears in the top of my screen and starts scrolling through all the artists on my ipod, looks like its scanning it or something i dont know.
    any help would be REALLY appreciated as i cant get new videos or games onto my ipod until i get the update working.
    cheers,
    ipod video 5G   Windows XP Pro  

    Check this thread out.
    http://discussions.apple.com/thread.jspa?messageID=3172375&#3172375

  • Need you help to update business area for FI Document  generated  at migo

    HI guys
    I am looking for MIGO Badi or user-exit which will help update business area which is mandatory field but when movement type 101and the account assignment tab is not there when the movement type is 101 at the time of GR so i want to update it BA in for FI Document generate  in background so as to complete the GR. 
    Thanks

    Hi Niraj ,
    I Have check the badi but there is no structure of FI item data  generated for which i can insert the BA for the line item generated
    Thanks
    Regards
    Nilesh

  • Plz i need your help , i updated my iphone 3G for ver6.0.1 but now its not work , what can i do ??

    Dear Sir/Mom
    now i updated my iphone 3G for the version 6.0.1 but now its not work , what can i do plz help me
    thank you

    What doesn't work?
    Has the iPhone been jailbroken?
    Do you have the app Cydia on your iPhone?

Maybe you are looking for

  • Anybody else having problems with airplay with ios 5.1 on iphone 4s

    So i bought an iphone 4s a few months back and it came with ios 5, i then tryed it with my airplay speakers and they kept cutting out so i googles about it and found there was a known problem with iphone 4s and airplay speakers. ios 5.0.1 then came o

  • OS X 10.10.1 update causes application crashes

    Since installing OS X 10.10.1 earlier today some of my applications/utilities will not open So far it's: Audi Midi, Disk Utility and System Report from "about this Mac". And that's just the ones I've tried. I went to Time Machine, but it does't allow

  • Undefine variables in PL/SQL

    Dear Friends, Iam using a PL/SQL script to enroll new users. At runtime we have to enter user name. If same user name already there then I need to display message and ask user to re-enter user name. The problem is When I go back it is not prompted fo

  • How do I save my itunes playlists etc when I change computers?

    I'm moving and selling my PC, but I got an external HDD to take with me and saved all my music to that. Is there a way I can also save my itunes and thus avoid remaking my playlists and saving my playcounts etc?

  • Gmail - Send Mail/Messages

    Hello, WHat is the difference between the Sent Mail Folder and the Sent Messages Folder on my Gmail accounts on my iPhone? I use IMAP. Any help would be much appreciated.