Problem with update a table

Hi,
--I need to update a table with only  year 2010  data, it looks like this:
update abc_tab set dept_cd = replace(dept_cd, 'HRE','HW')
where dept_cd in (select dept_cd from edu_tab e, edu_lkp l
where l.dept_rnd_cd =e.dept_rnd_cd
and l.fy_cd ='2010');
--when I run above query, it updated all the data in the column , not just  2010 data, but if I do following
(select dept_cd from edu_tab e, edu_lkp l
where l.dept_rnd_cd =e.dept_rnd_cd
and l.fy_cd ='2010');
-- I got only 2010 data, so what did I do wrong on the update statement?
Thanks a lot.
Wendy

data is not correlated based on DEPT_CD,
try this:
update abc_tab abc set abc.dept_cd = replace(abc.dept_cd, 'HRE','HW')
where abc.dept_cd in (select e.dept_cd
                      from   edu_tab e
                            ,edu_lkp l
                      where  l.dept_rnd_cd = e.dept_rnd_cd
                      and    e.dept_cd     = abc.dept_cd
                      and    l.fy_cd       = '2010'
commit
/

Similar Messages

  • Problem with updating a Table in LabVIEW 7

    I have a table on my front panel that I am using as a program control input. It has 3 columns, and adding certain values to these columns forces the program to do certain actions in a certain order. This part works fine, however if I ever want to reduce the number of rows in the table it all falls to pieces. This happens whether or not I reduce the number of rows whilst the program is running or in design mode. Despite what the table is displaying on the front panel it is always retaining the last data entered with a greater number of rows.
    e.g.
    I have 3 rows of information : Works fine
    I add 2 more rows for 5 rows used : Works fine
    I delete 1 row so now there are 4 : Still runs as if it had all 5 even though the front
    panel display says differently.
    The only way around this I have found is to right click the table and choose "Empty Table" but this is not a convenient solution for users of the software (who may well forget to do that).
    Is there any way to programmatically make sure the table only uses what it's meant to (ie what's showing on the front panel).
    I'm using a local variable to read in the values of the table within my program.
    Thanks
    Neil

    I've solved this problem now. I had an initializer on a feedback node wired incorrectly which caused unbounded increases in array size.
    Thanks for the suggestions I did receive
    Neil

  • Problem with updating DB table in using BAPI

    HI,
    The code below does not update the DB table even if the commit work is executed... is there something wrong or missing??? Thanks a lot!
    Technically complete process Order
           CALL FUNCTION 'BAPI_PROCORD_COMPLETE_TECH'
             IMPORTING
               return = i_messages
             TABLES
               orders = i_orders.
             IF i_messages-type NE c_error.
               REFRESH i_messages3.
               CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                 EXPORTING
                   wait   = 'X'
                 IMPORTING
                   return = i_messages3.
            ENDIF.

    Hi this is your code right.
    You have to check the return table not messages.
    Check the return table is there any message type is there with 'E' .
    if it is there then the commit work won't give the result in fact the BAPI function is not executed successfully.
    If you got any Error message in return table please have a look into that table errors and take the necessary action.
    Pass the required paramaters for the BAPI function module.
    Regards,
    Madan.

  • Issue with Update of Table VARINUM

    Hi,
    I am getting waiting Issues with Update of table VARINUM. Has anybody faced such an issue.
    I have a lot of Jobs which are running in background. I am submitting it through a report. what can be the issue.
    Regards,
    Abhishek jolly

    Thisi is quite old, but not answered properly yet, so there you go:
    SAP generates a new job and temporary variant on report RSDBSPJS, for each HTTP call,which creates database locks on table VARINUM .
    This causes any heavyweight BSP application  to hang and give timeout errors.
    The problem is fixed applying OSS note 1791958, which is not included in any service pack.

  • Issue with updating partitioned table

    Hi,
    Anyone seen this bug with updating partitioned tables.
    Its very esoteric - its occurs when we update a partitioned table using a join to a temp table (not non-temp table) when the join has multiple joins and you're updating the partitoned column that isn't the first column in the primary key and the table contains a bit field. We've tried changing just one of these features and the bug disappears.
    We've tested this on 15.5 and 15.7 SP122 and the error occurs in both of them.
    Here's the test case - it does the same operation of a partitioned table and a non-partitioned table, but the partitioned table shows and error of "Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'".
    I'd be interested if anyone has seen this and has a version of Sybase without the issue.
    Unfortunately when it happens on a replicated table - it takes down rep server.
    CREATE TABLE #table1
        (   PK          char(8) null,
            FileDate        date,
            changed         bit
    CREATE TABLE partitioned  (
      PK         char(8) NOT NULL,
      ValidFrom     date DEFAULT current_date() NOT NULL,
      ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    LOCK DATAROWS
      PARTITION BY RANGE (ValidTo)
      ( p2014 VALUES <= ('20141231') ON [default],
      p2015 VALUES <= ('20151231') ON [default],
      pMAX VALUES <= (MAX) ON [default]
    CREATE UNIQUE CLUSTERED INDEX pk
      ON partitioned(PK, ValidFrom, ValidTo)
      LOCAL INDEX
    CREATE TABLE unpartitioned  (
      PK         char(8) NOT NULL,
      ValidFrom     date DEFAULT current_date() NOT NULL,
      ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    LOCK DATAROWS
    CREATE UNIQUE CLUSTERED INDEX pk
      ON unpartitioned(PK, ValidFrom, ValidTo)
    insert partitioned
    select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    insert unpartitioned
    select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    insert #table1
    select "ET00jPzh", "Jan 15 2015", 1
    union all
    select "ET00jPzh", "Jan 15 2015", 1
    go
    update partitioned
    set    ValidTo = dateadd(dd,-1,FileDate)
    from   #table1 t
    inner  join partitioned p on (p.PK = t.PK)
    where  p.ValidTo = '99991231'
    and    t.changed = 1
    go
    update unpartitioned
    set    ValidTo = dateadd(dd,-1,FileDate)
    from   #table1 t
    inner  join unpartitioned u on (u.PK = t.PK)
    where  u.ValidTo = '99991231'
    and    t.changed = 1
    go
    drop table #table1
    go
    drop table partitioned
    drop table unpartitioned
    go

    wrt to replication - it is a bit unclear as not enough information has been stated to point out what happened.  I also am not sure that your DBA's are accurately telling you what happened - and may have made the problem worse by not knowing themselves what to do - e.g. 'losing' the log points to fact that someone doesn't know what they should.   You can *always* disable the replication secondary truncation point and resync a standby system, so claims about 'losing' the log are a bit strange to be making. 
    wrt to ASE versions, I suspect if there are any differences, it may have to do with endian-ness and not the version of ASE itself.   There may be other factors.....but I would suggest the best thing would be to open a separate message/case on it.
    Adaptive Server Enterprise/15.7/EBF 23010 SMP SP130 /P/X64/Windows Server/ase157sp13x/3819/64-bit/OPT/Fri Aug 22 22:28:21 2014:
    -- testing with tinyint
    1> use demo_db
    1>
    2> CREATE TABLE #table1
    3>     (   PK          char(8) null,
    4>         FileDate        date,
    5> --        changed         bit
    6>  changed tinyint
    7>     )
    8>
    9> CREATE TABLE partitioned  (
    10>   PK         char(8) NOT NULL,
    11>   ValidFrom     date DEFAULT current_date() NOT NULL,
    12>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    13>   )
    14>
    15> LOCK DATAROWS
    16>   PARTITION BY RANGE (ValidTo)
    17>   ( p2014 VALUES <= ('20141231') ON [default],
    18>   p2015 VALUES <= ('20151231') ON [default],
    19>   pMAX VALUES <= (MAX) ON [default]
    20>         )
    21>
    22> CREATE UNIQUE CLUSTERED INDEX pk
    23>   ON partitioned(PK, ValidFrom, ValidTo)
    24>   LOCAL INDEX
    25>
    26> CREATE TABLE unpartitioned  (
    27>   PK         char(8) NOT NULL,
    28>   ValidFrom     date DEFAULT current_date() NOT NULL,
    29>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    30>   )
    31> LOCK DATAROWS
    32>
    33> CREATE UNIQUE CLUSTERED INDEX pk
    34>   ON unpartitioned(PK, ValidFrom, ValidTo)
    35>
    36> insert partitioned
    37> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    38>
    39> insert unpartitioned
    40> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    41>
    42> insert #table1
    43> select "ET00jPzh", "Jan 15 2015", 1
    44> union all
    45> select "ET00jPzh", "Jan 15 2015", 1
    (1 row affected)
    (1 row affected)
    (2 rows affected)
    1>
    2> update partitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join partitioned p on (p.PK = t.PK)
    6> where  p.ValidTo = '99991231'
    7> and    t.changed = 1
    Msg 2601, Level 14, State 6:
    Server 'PHILLY_ASE', Line 2:
    Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'
    Command has been aborted.
    (0 rows affected)
    1>
    2> update unpartitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join unpartitioned u on (u.PK = t.PK)
    6> where  u.ValidTo = '99991231'
    7> and    t.changed = 1
    (1 row affected)
    1>
    2> drop table #table1
    1>
    2> drop table partitioned
    3> drop table unpartitioned
    -- duplicating with 'int'
    1> use demo_db
    1>
    2> CREATE TABLE #table1
    3>     (   PK          char(8) null,
    4>         FileDate        date,
    5> --        changed         bit
    6>  changed int
    7>     )
    8>
    9> CREATE TABLE partitioned  (
    10>   PK         char(8) NOT NULL,
    11>   ValidFrom     date DEFAULT current_date() NOT NULL,
    12>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    13>   )
    14>
    15> LOCK DATAROWS
    16>   PARTITION BY RANGE (ValidTo)
    17>   ( p2014 VALUES <= ('20141231') ON [default],
    18>   p2015 VALUES <= ('20151231') ON [default],
    19>   pMAX VALUES <= (MAX) ON [default]
    20>         )
    21>
    22> CREATE UNIQUE CLUSTERED INDEX pk
    23>   ON partitioned(PK, ValidFrom, ValidTo)
    24>   LOCAL INDEX
    25>
    26> CREATE TABLE unpartitioned  (
    27>   PK         char(8) NOT NULL,
    28>   ValidFrom     date DEFAULT current_date() NOT NULL,
    29>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    30>   )
    31> LOCK DATAROWS
    32>
    33> CREATE UNIQUE CLUSTERED INDEX pk
    34>   ON unpartitioned(PK, ValidFrom, ValidTo)
    35>
    36> insert partitioned
    37> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    38>
    39> insert unpartitioned
    40> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    41>
    42> insert #table1
    43> select "ET00jPzh", "Jan 15 2015", 1
    44> union all
    45> select "ET00jPzh", "Jan 15 2015", 1
    (1 row affected)
    (1 row affected)
    (2 rows affected)
    1>
    2> update partitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join partitioned p on (p.PK = t.PK)
    6> where  p.ValidTo = '99991231'
    7> and    t.changed = 1
    Msg 2601, Level 14, State 6:
    Server 'PHILLY_ASE', Line 2:
    Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'
    Command has been aborted.
    (0 rows affected)
    1>
    2> update unpartitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join unpartitioned u on (u.PK = t.PK)
    6> where  u.ValidTo = '99991231'
    7> and    t.changed = 1
    (1 row affected)
    1>
    2> drop table #table1
    1>
    2> drop table partitioned
    3> drop table unpartitioned

  • Problem with updating the PC Updater software

    Good evening (from Germany). I have a problem with updating my Nokia Software Updater. I can download the setup and I can execute this. But when the installation starts (0%) a error message appears. It's a problem with Windows Installer but I don't know how to solve the problem. Here is a picture with the exactly error message:
    http://img-up.net/?up=Nokia_probES8HJXXg.jpg
    I hope somebody knows the anser with this software...
    Greetings
    OS: Windows XP SP2
    Phone: Nokia 3110 classic Firmware: V 5.50
    Message Edited by dernamenlose on 24-Apr-2008 08:56 PM

    Good morning (from Denmark).
    I hve the same problem.
    OS: WinXP SP2
    Phone: N73.
    Greetings.

  • Problem with checkbox on table component

    Hello i am having a problem with checkbox in table component
    i am developing something like a shopping cart app and i have a checkbox in my table component , i want users to select items from the checkbox to add to thier cart, They can select the items from cartegory combobox , my problem is when they select the items from the checkbox if they select another category the alread selected once do not display in my collection opbject please how can i maintain the state of the already selected items in my collection object

    Hi,
    Please go through the tutorial "Understanding scope and managed beans". This is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    The details of the selected items need to be stored in an object that is in session scope.
    Hope this helps
    Cheers
    Girish

  • Problems with updating files in the cloud

    problems with updating files in the cloud

    What kind of problems?
    Have you recently upgraded to iCloud Drive on your iOS devices with iOS 8?
    Be aware, be careful, be prepared for iCloud Drive | TUAW: Apple news, reviews and how-tos since 2004

  • HT201210 nowadays have many user have problem with update to ios7 and need active with apple id maybe in the future in order escape from these problems must be stop use these products else. Because of simple user don't know about this technology and somet

    nowadays have many user have problem with update to ios7 and need active with apple id maybe in the future in order escape from these problems must be stop use these products else. Because of simple user don't know about this technology and sometime just hear from other user that it 's difficult to use then force they change phone that use to handle to another.

    It is a feature to discourage the theft of iPhones by making them useless if resold. It's not going anywhere. It's simple: just don't buy a phone until you make sure that the activation lock has been disabled.

  • Adobe Photoshop Elements Problem with update 9.0.3

    Problem with updates Elements 9.0.3
    Message title was edited by: Brett N

    Then follow the rest of the directions here:
    Error "Patch cannot be applied" | Photoshop Elements 9.0.3 update | Windows
    http://helpx.adobe.com/photoshop-elements/kb/error-patch-cannot-applied-photoshop.html

  • Problem with update Photoshop, Illustrator and Indesign CS6

    Hi all. I have problem with update Photoshop, Illustrator and Indesign CS6 on OSx 10.8.4. Application are OK but update (bug fixies) not working. Update failed. (U44M1P7)

    Hi El Gondo,
    The following might explain and help solve the problem...
    U44M1P7 - Updates :
    http://helpx.adobe.com/creative-suite/kb/error-u44m1p7-installing-upda tes-ccm.html
    U44M1P7, U44M2P7 - Creative Cloud Help / Can't apply Extension Manager update 6.0.2 | Mac OS :
    http://helpx.adobe.com/creative-suite/kb/unable-apply-extension-manage r-update.html
    Thanks!
    Ankit

  • Problem with update MUSE CC 2014.2 (october 6). after upgrading to the new version of Muse crashes very often (out without notice).

    Problem with update MUSE CC 2014.2 (october 6). after upgrading to the new version of Muse crashes very often (out without notice).

    HELP! i can't get ANYTHING done in the new muse - keeps closing.  once it crashes - i can't get the file back open!
    i've lost all my work!
    from my desktop - when it stared happening was with the updated version:
    Logging in build 2014.2.1.10 started at: Mon Nov 03 13:36:38 2014
    ========================================
    [00:00:42.416] Opening file '\\D-LAPTOP\_websites\dsbees muse\dsbees.muse' with status:success size:9797632 mod Date:Tue Sep 23 15:51:42 GMT-0500 2014 highestUID: 3548
    [00:01:03.898] Preparing to Save As over "\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse" exists: true
    [00:01:17.516] SaveAs complete for file '\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse' file size:9830400 mod Date:Mon Nov 3 13:37:51 GMT-0600 2014 highest UID:3551
    Build 232: Mon Nov 3 19:41:03 2014 UTC: Error: CSI: OOBE: Serial Number: Error Code: O-10 Error Message: Unable to retrieve the serial number (Note: this may not be an error)
    Build 232: Mon Nov 3 19:41:03 2014 UTC: Error: CSI: OOBE: Serial Number: Error Code: O-10 Error Message: Unable to retrieve the serial number (Note: this may not be an error)
    Build 232: Mon Nov 3 19:41:07 2014 UTC: Error: CSI: OOBE: Serial Number: Error Code: O-10 Error Message: Unable to retrieve the serial number (Note: this may not be an error)
    Build 232: Mon Nov 3 19:41:21 2014 UTC: Error: CSI: IMS: Connect: Error Code: I-200 Error Message: No Account
    Build 232: Mon Nov 3 19:41:21 2014 UTC: Unknown IMS error 'SHARED_NOACCT_ERROR' has occurred when retrieving IMS token.
    Build 232: Mon Nov 3 19:41:57 2014 UTC: Opening file '\\D-LAPTOP\_websites\dsbees muse\dsbees.muse' with status:This Adobe Muse site file requires a newer version of Adobe Muse. Please update to the latest version. size:9797632 mod Date:Tue Sep 23 15:51:42 GMT-0500 2014
    Build 232: Mon Nov 3 19:41:57 2014 UTC: This Adobe Muse site file requires a newer version of Adobe Muse. Please update to the latest version.
    Logging in build 2014.2.1.10 started at: Mon Nov 03 13:43:17 2014
    ========================================
    [00:00:21.481] Opening file '\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse' with status:success size:9830400 mod Date:Mon Nov 3 13:37:51 GMT-0600 2014 highestUID: 3551
    [00:00:30.373] AssertInDebug: Unable to run recovery. User file remains locked after 5 second pause.-assertInDebugOnly+DataBase/recover+MuseSite$/recover+MethodInfo-2886+DataBase$/run Recovery+apply+UIComponent/callLaterDispatcher2+UIComponent/callLaterDispatcher+end stack
    [00:00:30.404] Failed to recover file:\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse
    [00:00:30.420] Calling openConnection for file that doesn't exist? C:\Users\Owner\AppData\Roaming\com.adobe.AdobeMuseCC.2014.2\Local Store\Recovery\JXRoDn335LE0UosOdoStnQ Parent folder exists.
    [00:00:34.429] open of SQL connection failed for C:\Users\Owner\AppData\Roaming\com.adobe.AdobeMuseCC.2014.2\Local Store\Recovery\JXRoDn335LE0UosOdoStnQ
    [00:00:34.429] Failed to open mini-save connection B "C:\Users\Owner\AppData\Roaming\com.adobe.AdobeMuseCC.2014.2\Local Store\Recovery\JXRoDn335LE0UosOdoStnQ" Doesn't exist. Folder exists. error:SQLError: 'Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'
    [00:00:34.429] EXCEPTION:[SQLC/internalOpen] SQLError: 'Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'-SQLConnection/internalOpen+SQLConnection/open+DataBaseConnectionWrapper/o penConnection+MethodInfo-28954+EventDispatcher/dispatchEventFunction+EventDispatcher/dispa tchEvent+MethodInfo-28938+end stack
    [00:00:34.445] AlertAndExit because of: [SQLC/internalOpen] SQLError: 'Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'

  • Problem with updating adobe ilustrator CS6

    Hi
    I have problem with updating adobe ilustrator CS6. Error code: U43M1D204

    Please see the below similar discussions:
    http://forums.adobe.com/message/4913117#4913117#4913117
    http://forums.adobe.com/message/4169374
    Thanks!
    Ankit

  • I am having problem with updates CS5

    Hi,
    I am having problems with updating my CS5. I keep getting an error message "There was an error downloading this update. Please quit and try again later"
    Can you please help?
    Thank you
    Eli B

    See if doing it manually works
    All updates start here and select product, read to see if you need to install updates in number order, or if the updates are cumulative for the individual product http://www.adobe.com/downloads/updates/

  • Having problem with updating to 10.6.6 , my software now is 10.5.8, when the my mac is tellin me that i have already update to the lastest software when i haven`t :/ help !

    having problem with updating to 10.6.6 , my software now is 10.5.8, when the my mac is tellin me that i have already update to the lastest software when i haven`t :/ help !

    You need to find a store selling it and purchase it. If you buy it from an online store, it comes in the form of a DVD shipped to you.
    Unless Apple or someone with a site license applicable to you says otherwise, you can't download it.
    (60044)

Maybe you are looking for