Delete the data in table then update succesful

I write some code is work, then the update is fail , but if I delete the data in table then update succesful again, what is the possible reason??

Then you need to find out what you did wrong.
As you haven't even posted what you did, let alone what you did wrong, I don't know what magical process you're expecting forum members to engage in now.
This is the second meaningless question you have posted here today. I am locking them both.
In future if you want help here, you will need to provide a description of what you are trying to do, the code, what happened instead, and any error messages and stack traces, complete, cut and pasted rather than transcribed or otherwise mangled. Otherwise posting here is just a complete waste of everybody's time, including your own.
Moderator

Similar Messages

  • Delete the data based on last updated date

    Hi ,
    I have sample data like below.I want to delete the duplicate record but want to keep the latest record in the table.
    Assumptions:-- There are milion of records so I do not know the last_updated_date for the duplicate record
    EMP_NUMBER     LAST_UPDATE_DATE
    555954116     12/2/2008 9:28:54 PM
    555954116     9/7/2008 5:16:27 AM
    555954116     9/7/2008 5:16:27 AM
    555954116     9/7/2008 5:16:27 AM
    555954116     9/7/2008 5:16:27 AM
    555954116     9/7/2008 5:16:27 AM
    555954116     9/7/2008 5:16:27 AM
    Please suggest some idea.
    Regards
    Das

    Delete can be performed in two ways:
    1. Standard method to delete duplicates: Is good when number of duplicates are very small otherwise generates lot of UNDO/REDO logs.
    DELETE FROM emp a
    WHERE EXISTS ( SELECT NULL
                             FROM emp b
                             WHERE a.emp_number = b.emp_number
                             AND      a.last_update_date < b.last_update_date
    {code}
    2.  Copy-Paste : Is good when table is huge and a lot of duplicates as generate relatively less UNDO/REDO.
    {code:sql}
    -- Create table emp_temp having same structure/constraint/privilleges as original emp table
    CREATE TABLE emp_temp....DDL
    -- Copy latest employee record to temporary table
    INSERT INTO emp_temp(emp_number, last_update_date)
    SELECT emp_number, max(last_update_date) last_update_date
    FROM emp
    GROUP by emp_number;
    -- Drop original employee table.
    DROP TABLE emp CASCADE CONSTRAINT PURGE;
    -- Rename emp_temp to emp
    RENAME emp_temp to emp;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to delete the data from partition table

    Hi all,
    Am very new to partition concepts in oracle..
    here my question is how to delete the data from partition table.
    is the below query will work ?
    delete from table1 partition (P_2008_1212)
    we have define range partition ...
    or help me how to delete the data from partition table.
    Thanks
    Sree

    874823 wrote:
    delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
    Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
    How the table implements its structure is a physical design consideration.
    Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
    When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
    And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
    Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
    This is a crucial concept to understand and get right.

  • How can we delete the data in e-fact table.

    how can we delete the data in e-fact table.

    hii,
    You cannot delete the request individually but you can one of the following:
    1. Do a selective deletion from the cube. RSA1 -> Cube -> Contents -> selective deletion.
    2. Delete all the data in the cube and then reconstruct only the required request ids. This would work only if you have the PSA available for all the requests.
    3. Reverse posting is another possibility.
    hope it helps,
    partha

  • Restoring the data from table after deletion

    Hi,
    If  I delete the data from the database (using delete command) , is there anyway to restore that data. I know it looks bit weird but I'm checking whether there is any technique in abap by which we can restore the data.
    Your help would be appreciated.
    Thanks,
    Kranthi.

    Hi Kranthi,
               When you delete lines of a database table using the DELETE command, the process is only complete after a database commit. Before the commit, any database change can be reset using a database rollback.To be able to perform a database rollback, a database system must generate a copy of each database object before making a change. These copies are kept in a rollback log until the end of an LUW. An overflow of the rollback log always results in the termination of the transaction which caused it. For example, attempting to remind a large number of defaulting customers in the same transaction could trigger such an error. You can only solve this problem by dividing the set of database updates into several smaller units ( LUWs) for the database system. You use this statement if you cannot be certain that all the database changes have been executed correctly.
    For your information :
    An LUW begins each time you start a transaction,when the database changes of the previous LUW have been confirmed (database commit) or when the database changes of the previous LUW have been cancelled (database rollback)
    An LUW ends when the database changes have been confirmed (database commit) or when the database changes have been canceled (database rollback). Within an LUW, database changes are not made until after a database commit. Prior to this, any database change can be canceled by a database rollback.
    Cheers
    Nishanth

  • Function module updating the data base table

    Hi,
      This post is regarding the function module not updating the data base table.
    I am calling the FM SD_SHIPMENT_HEADER_CHANGE inside the ZFM. It's returning success an changing the  table c_xvttk_new with the new TDLNR value. But it's not updating the Shipment table VTTK-TDLBR or VT02N Forwarding agent.
    When I directly updating Forwarding agent in VT02N it's updating fine.
    Please let me know what the extra step need to be included to update or COMMIT the FM for updating
    Forwarding Agent(VTTK-TDLNR).
    Best Regards,
    Mahesh

    hi friend,
    This link wont five u the complete help but if u ananyse it  then it might provide u some idea......
    BAPI change shipment doc
    regards
    kanishak

  • How shall I delete the data from R/3 setup tables

    Hi Experts,
    How shall I delete the data from R/3 setup tables
    Regards
    Sailekha

    Hi Sailekha , to delete the set up table in r/3 either u can go to tcode LBWG as already mentioned or u can also delete the same from tcode SBIW
    Settings for Application-Specific DataSources (PI)  -
    Logistics -
    Managing Extract Structures -
    Initialization -
    Delete the Contents of the Setup Tables .
    Just click the clock there then u hace toi juct give the application component name like for Inventory 3 , then execute it , it will delete the set up table for inventory ..
    Regards..

  • How to delete the data loaded into MySQL target table using Scripts

    Hi Experts
    I created a Job with a validation transformation. If the Validation was failed the data passed the validation will be loaded into Pass table and the data failed will be loaded into failed table.
    My requirement was if the data was loaded into Failed database table then i have to delete the data loaded into the Passed table using Script.
    But in the script i have written the code as
    sql('database','delete from <tablename>');
    but as it is an SQL Query execution it is rising exception for the query.
    How can i delete the data loaded into MySQL Target table using scripts.
    Please guide me for this error
    Thanks in Advance
    PrasannaKumar

    Hi Dirk Venken
    I got the Solution, the mistake i did was the query is not correct regarding MySQL.
    sql('MySQL', 'truncate world.customer_salesfact_details')
    error query
    sql('MySQL', 'delete table world.customer_salesfact_details')
    Thanks for your concern
    PrasannaKumar

  • How to delete the data in a table using function

    hi all,
    i need to delete the data in a table using four parameters in a function,
    the parameters are passed through shell script.
    How to write the function
    Thanks

    >
    But the only thing is that such function cannot be used in SQL.
    >
    Perhaps you weren't including the use of autonomous transactions?
    CREATE OR REPLACE FUNCTION remove_emp (employee_id NUMBER) RETURN NUMBER AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    tot_emps NUMBER;
    BEGIN
    SELECT COUNT(*) INTO TOT_EMPS FROM EMP3;
    DELETE FROM emp3
    WHERE empno = employee_id;
    COMMIT;
    tot_emps := tot_emps - 1;
    RETURN TOT_EMPS;
    END;
    SQL> SELECT REMOVE_EMP(7499) FROM DUAL;
    REMOVE_EMP(7499)
                  12
    SQL> SELECT REMOVE_EMP(7521) FROM DUAL;
    REMOVE_EMP(7521)
                  11
    SQL> SELECT REMOVE_EMP(7566) FROM DUAL;
    REMOVE_EMP(7566)
                  10
    SQL>

  • HT204266 My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

  • Can we delete the archived RS tables data in unix path?

    Hi Experts
    As you all know that when we perform RS table archiving we setup a Logical file path 'ARCHIVE_GLOBAL_PATH' pointing to the physical path '/usr/sap/<SYSID>/SYS/global/<FILENAME>' in unix system.
    Here we have our RS table data in the unix path and this logical path will make sure that there are no problems with requests status.
    Now our unix path has grown in size hence we would like to delete some archived data from this path. Could you pls confirm if we delete the data from this unix path will there be any problems with the requests status?
    Simply can we delete the RS table archived data from the unix file path??
    Thanks!!

    Hi All
    Any idea about this would be appreciated.
    Thanks!!

  • How to delete the data in P,Q and S table

    Hi All,
    I want to delete the data in /BIO/PCOSTCENTER, /BIO/QCOSTCENTER AND /BIO/SCOSTCENTER. Since we have transported the costcenter infoobject from 3.0B to BI 7. But the 3.0B doesnot contain the ALPHA conversion. So we need to delete the infoobject and install from BI content.
    When I am trying to activate the BI 7 obj, It is giving the error message the above tables are containing the data.
    Pls suggest how to delete them and activate the 0COSTCENTER with BI 7 version.
    Points will be awarded.
    Thanks
    Sathiya

    Program RSDMD_DEL_BACKGROUND is the appropriate choice to delete master data.   You should be able to search OSS notes on te pgm to get a little more info on it.
    It insures referential integrity by checking all InfoProviders to make sure a master data value for that InfoObject does not exist in any InfoProviders.  This might not be an issue in your case if you are dealing with a newly activated object that you have don't have in any Infoproviders, but is the only the best way to delete master data.

  • Updating iTunes always deletes the data file behind my music in my library

    Hopefully, someone can help me. Everytime I update my iTunes, it somehow deletes the data files for my songs even though the song still appears in my library. When I go to listen or sync to my ipod it says it can't find the original data files and so I have to re-load all my CDs again, so I just basically don't update itunes anymore.
    Can anyone tell me why this is going on and how I can stop this from happening so that I can update itunes without losing all my songs?
    Thanks a bunch in advance!

    This appears to be a common problem lately on some computers ...try the following:
    Disconnect any iPod from the computer
    Temporarily remove any hackies or beta apps
    Make sure iTunes is in the original Apple install location=Applicatons Folder
    Refer to these Apple info docs:
    http://docs.info.apple.com/article.html?artnum=301749e
    http://docs.info.apple.com/article.html?artnum=93313
    Remember .... Seek and Ye shall find!!
    DIXIE

  • While deleting the data from cube..getting the following erros...

    while deleting the data from cube the below error occured in develoment..any help
    i have 4 requets.....2 are deltedd but no records for those...
    2 are not deleted and they have some data..
    please give me u r inputts pelase
    Performing check and potential update for status control table
    Message no. RSM1490
    Diagnosis
    If data is loaded into an InfoCube, or existing data is edited (aggregated/compressed/deleted/got from a DataMart), then there is a change in  the potential reportability of the data , or the possibility of deleting data by request, or of aggregating or compressing.
    This status of each one of these Cubes is stored in a status table, that is updated when there is any change to the status of a request in the Cube.
    The system now analyzes the requests in the Cube and compares the calculated status with the status table.
    If deviations from the status table arise then you are given the option of adjusting the status table.
    System Response Procedure Procedure for System Administration

    Hi,
    Did you tried by right click on cube and delete data? are those requests are compressed or roll up?

  • How to insert row in table control and save the data in tables

    Hi,
    I have one table control i am displaying data into table control ,
    my problem is : i want to display data into read mode in table control.
    but when i click on insert button on the same screen i want one blank line should inserted into table control , then i want to insert some data into table control on that row , when i click the save button . the new data inserted into the table control is insert that data into ztable ,
    please give me solution
    main problen is  how can know inserted line in table control and pass that data into ztable.

    Hi,
    Follow the below logic,
    PROCESS BEFORE OUTPUT.
      MODULE STATUS_0001.
      MODULE POPULATE_TABLE_CONTROL. --> Get the data from table store in 
                                                                          ITAB
      LOOP AT GT_CTRL_LP_D516 INTO GS_WA_CTRL_LP_D516
           WITH CONTROL CTRL_LP_D516
           CURSOR CTRL_LP_D516-CURRENT_LINE.
      The following module moves data to control
        MODULE MOVE_TO_CONTROL.--> Move data from ITAB to table control
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP AT GT_CTRL_LP_D516.
      ENDLOOP.
      MODULE EXIT AT EXIT-COMMAND.
      MODULE USER_COMMAND_0001.  --> Here you have to take out the values from table control and update database table
    Reward points if helpful.
    Thanks and regards,
    Mallareddy Rayapureddy,
    Munich, Germany.

Maybe you are looking for