need to remove duplicate rows from a table

Hi gurus,

I'm using oracle 11.2.0.3.

SQL > desc osstage. S_EVT_ACT_X;

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

ROW_ID NOT NULL VARCHAR2 (15 CHAR)

LAST_UPD NOT NULL DATE

PAR_ROW_ID NOT NULL VARCHAR2 (15 CHAR)

ATTRIB_17 NUMBER (22.7)

DATE OF ATTRIB_26

ATTRIB_02 VARCHAR2 (100 CHAR)

PROCESS_TIMESTAMP TIMESTAMP (6);

now, when I give the command below, it gives error as someone has disabled the constraint accidentally.

change the table s_evt_act_x S_EVT_ACT_X_P1 enable constraint;

Error from line 3 in order:

change the constraint of table s_evt_act_x activate S_EVT_ACT_X_P1

Error report:

SQL error: ORA-02437: impossible to validate (OSSTAGE. S_EVT_ACT_X_P1) - primary key violated

02437 00000 - "can't validate (s.%s) - primary key violated."

* Cause: attempted to validate a primary key with duplicate values or null

values.

* Action: remove duplicates and nulls before enabling a primary

key.

You can guide me please with this question.

Please see

Script: Remove the duplicate of a Table (Doc ID 31413.1) lines

How to find or remove the duplicate in a Table (Doc ID 1004425.6) lines

Tags: Database

Similar Questions

  • Script to remove all rows from a table except the first

    Please see the screenshots for the question/radio button I'm scripting.  If 'No' is clicked, I want to delete all lines except the first.  Therefore, if the first user clicks Yes, adds a bunch of lines and then click on no, I want all the extra lines should be deleted.  I use the script below, but it removes only half of the lines at a time.  I have to click No. 2 - 3 times to remove all the lines.  Appreciate any help!

    // remove extra rows that may have been added
    var rowCount = Page2.UserList.Table1._RowUserName.count;
    for (var i=0; i<rowCount; i++) {
      Page2.UserList.Table1._RowUserName.removeInstance(i);
    }
    
    

    LCD1.png

    lCD2.png

    Hello

    You can directly use the method setInstances of the instanceManager as follows:

    Page2.userlist.Table1._RowUsername.setInstances (1);

    I hope this will help you!

  • How to remove duplicate rows (not exactly duplicate)

    Hi I have lines like this in a table emp

    ENO ename age
    1 25
    26 2
    3 25
    4 26

    I don't have repititve enames... (here in this example: A).

    If I find something like that I should keep the first line and delete all other lines.

    How can I do this?

    as unique empowerment of ename... (except for this)

    Hi Renon,
    There are different ways could remove duplicate rows, but Franks solution seems good.
    With the help of ID you can get good results in the largest data sets. If you want Nwe minutes remain in the database and all others to delete then make use of eno and not rowid.

    DELETE FROM emp y
    WHERE       eno != (SELECT   Min(eno)
                        FROM     emp x
                        WHERE    x.NAME = y.NAME
                        GROUP BY NAME)
    

    HTH
    SS

  • How to truncate 1000 rows from a table of 7000 lines?

    Hello

    Please give me a quick answer to truncate the 1000 rows from a table of 7000 lines... I don't want to truncate the entire table

    Thank you all for the valuable support,

    My activity is still ongoing... Somehow my client was not specific about what lines are deleted. It has no date column in the table to delete records by date...

    The table contains information about the error logs, so he wanted to keep a few lines and remove the rest... and then copy the table to another database.

    So right now using this query:

    SQL > delete (select * from ) where rownum<>;

    Once again thank you to all...

  • Need help to insert rows in the table to a custom table area

    Hi all

    I have a requirement as below.

    I have a page of the i invoke a popup search page and displaying the table data in the area of the table, this table I select lines and pressing the button and given in the basic page in the region of the table being filled, of data, I need to insert these lines into a custom table. Please help me how to achieve this. Basically, I need to insert rows from one table to a custom table region.

    Thnaks

    Hello

    Review the link, below, may be it will help you:

    https://forums.Oracle.com/thread/953885

    https://forums.Oracle.com/thread/2151775

    Please share your solution here, it will help others.

    Concerning

    Mahesh

  • you need to remove the license from computer to move to another PC.

    you need to remove the license from computer to move to another PC.

    It is all the information that I have and you can get on the product. I don't know when and who has been sold, or whose key is. Asked me to pass the software of an older laptop to a new laptop.

    Good luck with that.  Without a legitimate serial number, you're stuck.

    Download the Pro or Standard of X, XI or Acrobat DC versions

    Nancy O.

  • I have a table of the adf, I added a column that contains a button that I created, when I click it must remove this row in the table, but it is not, please help

    I have a table of the adf, I added a column that contains a button that I created, when I click it must remove this row in the table, but it is not, please help

    I don't understand. You use vo and eo for you to use business components.

    Again, this kind of code call in trouble.

    You must post the changes to make them visible to the eo find vo. You must then run the query for the changes in the business layer strips then you must update the iterator he table is based on.

    In your code I see that happen, hooch maybe because it is more often than not formatted and undocumented.

    My advice is to do a small test case that you can manage with easy sql. Once you get it to run transfer you the results to the actual application.

    Timo

  • How to remove a column from a table in a dell identtiymananger 7.0

    How to remove a column from a table in a dell identtiymananger 7.0

    Hello

    In Version 7 of the removal of a single custom column can be accomplished by a stored procedure, available in the database called: QBM_PColumnDrop

    Hope that helps.

    Cordially Fatih

  • Add / remove rows from the Table

    Hello

    I'm really new to LiveCycle ES 8.2 (= non-existent knowledge of JavaScript) and has difficulties to create a table that can add / remove lines.

    I found a model that has the feature I need, but am unable to reproduce the table. (Ref. "Fax Cover Sheet_SW.pdf' http://forums.adobe.com/message/2561553#2561553)

    Even when I create a new blank form, and then copy / paste the table (subforms: 'detailHeader' + "detal") in the new, blank forms, the table stops working. The buttons are more clickable in the LiveCycle 'Preview PDF'

    In the new, blank forms, the 'Paging' and 'Binding' tabs have some or all of their features grayed out.

    I tried the following:

    1. Save the form as an "Adobe Dynamic form XML (pdf)"
    2. Make sure all of the 'content' subform fields were set to "Position" instead of "Flowed".

    What am I missing, like all JavaScript copied on, but for some reason any does not work.

    4 things you need to correct your form...

    (1) Page1 subform needs tobe Flowed the value.

    (2) then the link to the Subform1 tab will be active. You must check the box "subform to repeat for each item of data.

    (3) in the Add button to Subform1 you missed 'instanceManager' in the code...

    Subform1.instanceManager.addInstance (1);

    (4) in the same way in the button Delete

    Subform1. instanceManager. removeInstance (this.parent.index);

    Thank you

    Srini

  • Delete rows from a table in expansion

    Hello

    I have a table in expansion that allows users to click on a button '+' of the line to add as many lines.  The table contains mandatory fields.  There is an option button in another part of the form if the value 'No', the whole of the section containing the table is hidden.  I need to remove extra lines, that the user may have added to the table before selecting that 'No' answers, leaving only the first three ranks (title 2 rows and the first line of data).  If the table had six names (total 8 rows) so I want to remove 7 rows. I have remove the value from the first row separately.  I tried something like that, but I couldn't make it work; I'm not a very experienced scripter.  Thank you.


    for (var oLen = Table1.nodes.length; oLen > 3; t ++) {}

    Table1.parent.parent.instanceManager.removeInstance (oLen);

    }



    Hello

    There is a mistake in your statement.

    You start the last instance of the line and you want to remove all the lines from the last to the 3rd row...

    You must change your value when you remove 1 row, but instead to change the value of oLen you change the variable "t".

    Also if you are a beginner as a last resort, and down to the third row, you can decrease the index you use rather than increase it.

    So you're code need some minor changes, and it should look like this:

    for (var Table1.parent.parent.instanceManager.count - 1; oLen = oLen > 3; oLen-) {}

    Table1.parent.parent.instanceManager.removeInstance (oLen);

    }

    I hope this helps!

  • A script to remove all rows in the table that contains a specific text

    Hello

    I tried some old scripts but cannot move to the right solution.

    I need a script that deletes all the rows in a table that contains a specific unique word text, something like "xxx".
    Someone has an idea?

    Thank you

    Hello

    To remove a line using row.remove () method.

    Iterate if table.rows and delete the matching condition.

    If we talk about condition, be more specific - what do you mean "a line contains a text:

    ==> 1st cell contains,

    ==> any cell contains.

    Content of the line whole is an array of his cells.contents, so your text from line 1 is:

    rows [0].contents.join ("") ==> string

    Jarek

  • Remove a line from several tables

    Hello

    I have a form that has what appears to be a single table.  Given that I needed 30 column (29 of them are single character fields) I had to use 2 objects from the table.  Then I had the ability to add and delete lines.  Add a line at the end is pretty easy.  Deleting a specific line is the problem.  For now, I added a third table that has a header line and a line of item body.  the body line is a button with the intention to withdraw this entire line of the table.  In other words, need remove the line in all 3 tables.

    My structure is:

    • Form1
      • (Some other subform past who is not serious for us)
      • SubformPersonnel (a subform sank)
        • SubformHeader (a positioned subform)
          • TextOverallHeader (text to label the oeverall 3 tables)
          • ButtonAddRow (adds a line at the end of all 3 tables)
        • SubformPersonnelTable (a positioned subform)
          • ContractorTableRemove (a table with a 1 column for the button Delete)
            • HeaderRow (line hidden to align the table with the other 2)
            • Element (a line with the button Delete)
              • CellRemoveButton (the cell with the button Delete and associated JavaScript)
          • ContractorTableLeft (a table with the left 15 printed columns)
            • HeaderRow
            • Contractor (a row of data to be deleted when it is clicked on CellButton above)
          • ContractorTableRight (a table with the right 15 printed columns)
            • HeaderRow
            • Contractor (a row of data to be deleted when it is clicked on CellButton above)
      • (Some other subforms that I'm not worried at the moment)

    The 3 tables are aligned to the headers of all line up, no space between them.  Body lines line up then and it looks like a large table.  From left to right, they are:

    ContractorTableRemove, ContractorTableLeft, ContractorTableRight

    Point lines and contractor are added when you click on ButtonAddRow in the header of all.  The initial number is set to 8 for each table, so I get 8 rows at the start. The minimum number is set to 1 for each.  I know that each row in each table has the same index number, because I filled in a cell in each table cell initialize durig.  This line, in the click event of the CellRemoveButton removes the row of the cell in this table:

    This.parent.parent._item.removeInstance (this.parent.index);

    I tried all kinds of ways to remove the same line (using the index #) in the other 2 tables: ContractorTableLeft and ContractorTableRight, but do not seem to get the correct correct syntax.  I tried hard coding references, using .parent as shown below and also tried to use an index 1 just to try deleting a line with no result.

    this.parent.parent.parent.ContractorTableLeft._Contractor.removeInstance (this.parent.inde, x);

    Can someone get me the correct syntax here?

    For example put a button Delete hidden on each table, click on that I saw, but I'm afraid it will get in the tables on each side of the table, in that it is the trail.  I reeally want just to refer to the line and remove it if I can avoid all these problems of further removal can cause problems.

    I copied the form to https://Acrobat.com/#d=7M8R50rEHf4AaVXppwyKLw

    Hi Karl,

    Here is your form you: https://acrobat.com/#d=oRRJP3W * OgBk6DqXXbJhgg.

    I've corrected the Add button, the button Delete and remove the button at the top. I annotated the script, so I hope you can follow.

    Hope that helps,

    Niall

  • Help with reverse remove duplicate rows?

    Hello:

    I have an application where I need to delete duplicate lines reversed, like this:

    Select 'A' x, y 'B' double
    Union of all the
    Select 'C', had "double
    Union of all the
    Select 'B', 'A' from dual;

    The output is:

    X Y
    - -
    A AND B
    C D
    B HAS

    What I need is to remove the line 'A B' because there is already a form of reversed like "A B". It does not matter which line is maintained, 'A B' or 'A B'. One of them should be removed and the other needs to stay.

    Note that the actual query to generate the data is a little more complicated, but I can use a clause to make a notice online. I hope that the real mechanics is irrelevant. If this isn't the case, please let me know and I'll post more information on the actual query.

    Any ideas?

    Hi pasinc,

    Here is a way. I am sure someone will come up with a smarter.

    SQL> with your_data as (select 'A' x, 'B' y from dual
                       union all
                       select 'C', 'D' from dual
                       union all
                       select 'B', 'A' from dual)
    select x, y from your_data
    minus
    select t1.x, t1.y
      from your_data t1, your_data t2
     where t1.x = t2.y
       and t1.y = t2.x
       and t1.x > t1.y
    
    X Y
    - -
    A B
    C D
    
    2 rows selected.
    

    Concerning
    Peter

  • LOV in richeTableau resets the value after the deletion of rows from the table

    Hello. I'm on 11g R2

    I have a table with columns in the box and a button in the toolbar that removes the lines checked

    I have build it based on the following article in her string code

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html


    When I run the "delete" button I execute the following code (taken as is article)


    public void deleteSelectedRows() {}

    create a second line, the value do not affect all lines

    used in ADF

    Set of rows duplicateRowSet = this.createRowSet ("duplicateRowSet");

    first row to avoid "the attempt to access the value of lines."

    exception line was dead.

    duplicateRowSet.first ();

    retrieve the current row of the table for after

    re-running the VO

    Line currentRow = this.getCurrentRow ();

    Boolean currentRowDeleted = false;

    get all rows that have the transoent attribute

    "MarkForDelete' set to true

    Row [] rowsToDelete =

    duplicateRowSet.getFilteredRows ("MarkedForDelete", true);

    If (rowsToDelete.length > 0) {}

    run only throizgh this code, if there is something to

    delete

    for (line rw: rowsToDelete) {}

    If the row is marked as the current in VO, ts value

    Boolean flag

    If (rw.getKey () .equals (currentRow.getKey ())) {}

    currentRowDeleted = true;

    }

    remove the line - do not yet commit

    RW. Remove();

    }

    rerun VO

    this.executeQuery ();

    reset the current line if it has not been removed

    If (! currentRowDeleted) {}

    this.setCurrentRow (currentRow);

    }

    duplicateRowSet.closeRowSet ();

    }

    }

    "MarkedForDelete" is a transient attribute used to mark the line delete

    The lines are removed very well.

    The problem is with lines that I do not delete.

    For example I LOV column. I chose the value LOV in a few lines, and after that choose to delete several lines (not the same lines where I modified the LOV) but some other lines.

    After I click "delete", the lines that I marked to remove deleted indeed, but the value of the LOV in other rows (I have not scored for delete) are disabled.

    How to preserve value LOV so it will remain also after I deleted some lines?

    P.S. I've tried autosubmit = "true" - it did not help

    It is expected because I see that you rerun the query.

    Once you re - run, it retrieves from the database again. Thus, your values are lost because they are not posted.

    I don't think that run query is necessary, try to have a programmatic part trigger on the table after you remove all of the lines.

    Thank you

    Alisson.

  • Remove duplicates in an oracle table

    Hello

    I want to remove duplicates from a table of account

    Contains 2 column Account_id and Account_type

    counts the values in the table are

    Account_id Account_type
    1 GPR
    1 GPR
    1 GPR


    I want only one entry and delete the other entry with Account_Id = 1

    Thank you
    Petri

    One of the ways is...

    delete accounts
    where rowid not in (select max (rowid) of the Group of accounts by account_id, account_type)

    Concerning

Maybe you are looking for

  • Replacement of LCD in Tecra S2

    Hello!Unfortunatelly, matrix LCD in my computer laptop Toshiba Tecra S2 came down and I need to replace it. Initially, it came with 15 "1024 x 768 resolution display, but I discovered that some Tecra S2s were shipped with LCD resolution 1400 x 1050.S

  • Satellite L755D - 14 c does not detect Bluetooth after installing Win 7

    I have laptop Toshiba Satellite L755D - 14 c and I used to use my internal Bluetooth in my old system of operating Windows 7 64 bit, then I reinstalled Windows 7 and all of a sudden the Bluetooth went I tried to installed the driver but nothing happe

  • M100: Need driver for SD Card Host Controller & IR Port

    Hello Can someone tell me if I can get the drivers for M100 Secure Digital (SD) Host Controller Card? I had an accident on my M100 and had to rebuild my machine, everything works fine expect the IR Port & SD Card. Can someone tell me if I can get the

  • Recovery without reformatting

    "I have a"HP Pavilion p6616f desktop PC with windows 7 Professional 64-bit. I have the CD of restoration but when I boot from them, it seems he wants to format the hard drive to do the recovery. I don't want to do that. I want to reload all software

  • HP Photosmart 5514 does not print correctly

    I have a HP Photosmart 5514 All-in-on the printer. I restarted my laptop and now it does not print right. The printer prints the test page (chosen among the parameters of the printer) just as it should and it also prints everyting I scanned (pdf), bu