Deleting a row from advance table:urgent

Hi All,
I am using Advance table with "Add Another Row" button.Situation is like this, i have an empty row and an exsist row in my Table. Against each row i have a Delete image.Now my problem is, when I am clicking on the Delete image, i am getting the empty row id which is there is the VO cache,not the one against which i have clicked on the Delete image.Please help me to solve this problem.
Thanks in Advance,
Vikram

For the Delete image, why dont you enable a firePartialAction on that and use SPEL binding to pass a unique id (like an <object>_id) as an EVENT PARAM to the Controller. From there on you can pass it to the AM and delete that particular row.
For adding a new row, if you use the default add row feature in the advanced table and set the Insert Rows Automatically property to true, it should take care of inserting the rows by default at the end of your existing rows, without you having to write any code for it.
If, on the other hand, you want to manually add the new row yourself, such as for defaulting some values into the new row, then you might want to explore if insertRowAtRangeIndex will work.

Similar Messages

  • Deleting a row from parent table

    Dear Guru's
    I am having two table with parent - child relationship. My problem is when I am deleting a row from parent table the curresponding child row from child table also should be deleted.
    My Primary table 'Employee, EMPID Primary key
    Child table 'Privilage' inthis EMPID referencing the EMPID of Employee table
    My need is when I am deleting a row from parent table the curresponding child row from child table also should be deleted
    I issued the SQL query like,
    delete from employee where empid='12345' cascade constraints;
    Then it showing me error like,
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    Please resolve my issue , Its Top urgent
    Thanks & Cheers
    Antony

    Choosing How Foreign Keys Enforce Referential Integrity
    Oracle Database allows different types of referential integrity actions to be enforced, as specified with the definition of a FOREIGN KEY constraint:
    Prevent Delete or Update of Parent Key The default setting prevents the deletion or update of a parent key if there is a row in the child table that references the key. For example:
    CREATE TABLE Emp_tab ( 
    FOREIGN KEY (Deptno) REFERENCES Dept_tab);Delete Child Rows When Parent Key Deleted The ON DELETE CASCADE action allows parent key data that is referenced from the child table to be deleted, but not updated. When data in the parent key is deleted, all rows in the child table that depend on the deleted parent key values are also deleted. To specify this referential action, include the ON DELETE CASCADE option in the definition of the FOREIGN KEY constraint. For example:
    CREATE TABLE Emp_tab (
        FOREIGN KEY (Deptno) REFERENCES Dept_tab 
            ON DELETE CASCADE); Set Foreign Keys to Null When Parent Key Deleted The ON DELETE SET NULL action allows data that references the parent key to be deleted, but not updated. When referenced data in the parent key is deleted, all rows in the child table that depend on those parent key values have their foreign keys set to null. To specify this referential action, include the ON DELETE SET NULL option in the definition of the FOREIGN KEY constraint. For example:
    CREATE TABLE Emp_tab (
        FOREIGN KEY (Deptno) REFERENCES Dept_tab 
            ON DELETE SET NULL);
    SQL> conn scott/tiger
    Connected.
    SQL> create table ppk ( no number primary key);
    Table created.
    SQL> begin for inn in 1..10 loop insert into ppk values (inn); end loop; end;
    PL/SQL procedure successfully completed.
    SQL> create table ffk ( no number references ppk(no));
    Table created.
    SQL> begin for inn in 1..10 loop insert into ffk values (inn); end loop; end;
    PL/SQL procedure successfully completed.
    SQL> drop table ppk cascade constraints;
    Table dropped.Message was edited by:
    user52
    Message was edited by:
    user52
    Message was edited by:
    user52

  • Deleting a row from a table containing CLOB as one of the columns

    When i delete a row from a table which contains a CLOB (internal clob) i.e. CLOB or BLOB column, Will the CLOB data will also be deleted ? I understand that what exactly stored in the CLOB column is the clob locator which points to the actual data.
    So, when I delete this row, the clob locator will be deleted, but will the actual data what this locator is pointing to is also deleted ??? if not what is the process to delete the data the locator is pointing to when the row containing the locator is deleted ? If this is not happening then the actual data might become an orphan data which nobody has access to, will automatic garbage cleaning occurs on a frequent intravels to delete unaddressed data residing on the database server ?
    Thanks in advance for the help, can email me at [email protected] alternatively.
    Regards,
    Srinivasa C.

    Michael,
    Thanks very much for your inputs, here are the results i got when i tried the way you explained in your answer, the TRUNCATE command made the actual size back to normal, but the delete is not the same, so, how can i delete the data that a particular clob locator may point to ?
    truncate would delete all the rows of the table, which might not serve my purpose, i would like to delete a row and also it's associated clob data from the database! is there anyway to do this ?
    is there any limitation on the ool_sample size? i am basically a c++ programmer, i am looking for some function like FREE which would free the allocated memory to the clob once the locator is deleted.
    your help is greatly appreciated - Thanks!
    :-) Srini.
    ==========================
    My Results:
    ==========================
    SQL> create table sample (
    2 id integer primary key,
    3 the_data CLOB default empty_clob() )
    4 lob (the_data) store as ool_sample;
    Table created.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    20K
    SAMPLE
    10K
    SQL> select count(*) from sample;
    COUNT(*)
    0
    SQL> begin
    2 for i in 1..1000
    3 loop
    4 insert into sample values (i, RPAD('some data', 4000) );
    5 end loop;
    6 end;
    7 /
    PL/SQL procedure successfully completed.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    6420K
    SAMPLE
    70K
    SQL> delete sample;
    1000 rows deleted.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    6420K
    SAMPLE
    70K
    SQL> commit;
    Commit complete.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    6420K
    SAMPLE
    70K
    SQL> begin
    2 for i in 1..1000
    3 loop
    4 insert into sample values (i, rpad('some data', 4000));
    5 end loop;
    6 end;
    7 /
    PL/SQL procedure successfully completed.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    9616K
    SAMPLE
    70K
    SQL> truncate table sample;
    Table truncated.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    20K
    SAMPLE
    10K

  • Issue while deleting a row from a table

    Dear friends,
    i am getting an issue while deleting a row from a table, pls check screen shots , the first screen shot is my table contents
    when i delete 2 row , the second row is deleting properly like below screen shot
    but i want like below screen shot , Col1 contents should be like pic 1 . could any one pls let me know how to solve this issue.
    Thanks
    Vijaya

    Hi vijaya,
    please try this code, it will help you.
    DATA : it_rows  TYPE wdr_context_element_set,
              wa_rows LIKE LINE OF it_rows.
       DATA lo_nd_table TYPE REF TO if_wd_context_node.
        DATA lt_table TYPE wd_this->elements_table.
       DATA lo_el_table TYPE REF TO if_wd_context_element.
       DATA ls_vbap TYPE wd_this->element_table.
    DATA: ld_index TYPE i.
    data value TYPE sy-index.
    * navigate from <CONTEXT> to <table> via lead selection
       lo_nd_table= wd_context->get_child_node( name = wd_this->wdctx_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
    * get element via lead selection
    * alternative access  via index
    * lo_el_table = lo_nd_table->get_element( index = 1 ).
    * @TODO handle not set lead selection
       IF lo_el_table IS INITIAL.
       ENDIF.
    * navigate from <CONTEXT> to <table> via lead selection
       lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
       lo_nd_table->get_static_attributes_table( IMPORTING table = lt_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
    ** @TODO compute values
    ** e.g. call a model function
    * navigate from <CONTEXT> to <table> via lead selection
       lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
    ** @TODO compute values
    ** e.g. call a model function
    it_rows  =  lo_nd_table>get_selected_elements( ).
       CALL METHOD lo_nd_table->GET_LEAD_SELECTION_INDEX
       RECEIVING
         INDEX  = value .
      LOOP AT it_rows INTO wa_rows.
         CALL METHOD wa_rows->get_static_attributes
           IMPORTING
                  static_attributes = ls_table.
         READ TABLE lt_table INTO ls_table WITH KEY col1 = ls_table-col1.
          ld_index = value.
              ENDLOOP.
       CLEAR : ls_table-col2,
             ls_table-col2.
       MODIFY lt_table INDEX ld_index FROM ls_table.
      lo_nd_table->bind_table( new_items = lt_table set_initial_elements = abap_true ).

  • Best practice for deleting multiple rows from a table , using creator

    Hi
    Thank you for reading my post.
    what is best practive for deleting multiple rows from a table using rowSet ?
    for example how i can execute something like
    delete from table1 where field1= ? and field2 =?
    Thank you

    Hi,
    Please go through the AppModel application which is available at: http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
    The OnePage Table Based example shows exactly how to use deleting multiple rows from a datatable...
    Hope this helps.
    Thanks,
    RK.

  • Deleting Multiple Rows From Multiple Tables As an APEX Process

    Hi There,
    I'm interesting in hearing best practice approaches for deleting multiple rows from multiple tables from a single button click in an APEX application. I'm using 3.0.1.008
    On my APEX page I have a Select list displaying all the Payments made and a user can view individual payments by selecting a Payment from the Select List (individual items are displayed below using Text Field (Disabled, saves state) items with a source of Database Column).
    A Payment is to be deleted by selecting a custom image (Delete Payments Button) displayed in a Vertical Images List on the same page. The Target is set as the same page and I gave the Request a name of DELETEPAY.
    What I tried to implement was creating a Conditional Process On Submit - After Computations and Validations that has a source of a PL/SQL anonymous block as follows:
    BEGIN
    UPDATE tblDebitNotes d
    SET d.Paid = 0
    WHERE 1=1
    AND d.DebitNoteID = :P7_DEBITNOTEID;
    INSERT INTO tblDeletedPayments
    ( PaymentID,
    DebitNoteID,
    Amount,
    Date_A,
    SupplierRef,
    Description
    VALUES
    ( :P7_PAYMENTID,
    :P7_DEBITNOTEID,
    :P7_PAID,
    SYSDATE,
    :P7_SUPPLIERREF,
    :P7_DESCRIPTION
    DELETE FROM tblPayments
    WHERE 1=1
    AND PaymentID = :P7_PAYMENTID;
    END;
    The Condition Type used was Request = Expression 1 where Expression 1 had a value of DELETEPAY
    However this process is not doing anything!! Any insights greatly appreciated.
    Many thanks,
    Gary.

    ...the "button" is using a page level Target,...
    I'm not sure what that means. If the target is specified in the definition of a list item, then clicking on the image will simply redirect to that URL. You must cause the page to be submitted instead, perhaps by making the URL a reference to the javaScript doSubmit function that is part of the standard library shipped with Application Express. Take a look at a Standard Tab on a sample application and see how it submits the page using doSubmit() and emulate that.
    Scott

  • How to save the  selected rows from Advance table into database

    Hi
    I have requirement like..
    In custom page , Manager Search the Candidates and selects the candidate ROWS from advance table.
    The reqt is how to save the selected multiple rows into the database.

    hi Reetesh,
    In Custom page
    Supoose the Recruiter Search is for Position Finance Mangager , it retrieves 100 rows , out of which Recruiter select 10 rows .
    So in Such scenario how to save this 10 rows against Recruiter
    , i mean , Is i need to create custom table, to save Recruiter , these selected 10 rows.
    I hope u understand my question

  • Delete many rows from one table at once URGENT

    Assume we have table called emp.
    table desription:
    SQL> desc emp
    Name Null? Type
    EMPNO NOT NULL NUMBER(6)
    DIVISION NOT NULL NUMBER(3)
    JOB_NO NOT NULL NUMBER(4)
    START_DATE NOT NULL DATE
    select * from emp;
    EMPNO--------DIVISION--------JOB_NO------------START_DATE
    1111------------------011-------------8181--------------04/10/1999
    1111------------------011-------------8181--------------04/10/2004
    2222------------------011-------------3131--------------05/11/2005
    3333-----------------022-------------8181--------------06/09/2001
    3333-----------------044-------------8181--------------06/08/1988
    5555-----------------011-------------8066--------------01/01/2001
    6666-----------------033-------------9600--------------01/01/1999
    7777-----------------044-------------8181--------------06/24/1996
    7777-----------------033-------------8181--------------12/02/1991
    7777-----------------033-------------8181--------------03/01/2002
    9999-----------------044-------------9191--------------03/05/1980
    9999-----------------055-------------9191--------------03/06/1989
    My goal is to delete employee records for those employee which contains multiple values for JOB_NO
    equal to 8181, (JOB_NO= 8181) with new start_dateS.
    We need to keep only one record for JOB_NO 8181 which contains oldest start_date.
    Here is the delete statement for the single record.
    delete from emp
    where empno = 7777 and job_no = 8181 and start_date in ('03/01/2002','06/24/1996);
    So how could I delete thousands records from the table with this logic?
    After deleting multiple records table should be as below:
    select * from emp;
    EMPNO--------DIVISION--------JOB_NO---------START_DATE
    1111-----------------011-------------8181--------------04/10/1999
    2222-----------------011-------------3131--------------05/11/2005
    3333-----------------044-------------8181--------------06/08/1988
    5555-----------------011-------------8066--------------01/01/2001
    6666-----------------033-------------9600--------------01/01/1999
    7777-----------------033-------------8181--------------12/02/1991
    9999-----------------044-------------9191--------------03/05/1980
    9999-----------------055-------------9191--------------03/06/1989

    Here's one way to do it. I think this fits your business rules. At least it matches the output for your first example. It uses an analytic. I just like using them.
    SQL> select * from employees;
                   EMPNO             DIVISION               JOB_NO START_DATE
                    1111                   11                 8181 10-APR-1999
                    1111                   11                 8181 10-APR-2004
                    2222                   11                 3131 11-MAY-2005
                    3333                   22                 8181 09-JUN-2001
                    3333                   44                 8181 08-JUN-1988
                    5555                   11                 8066 01-JAN-2001
                    6666                   33                 9600 01-JAN-1999
                    7777                   44                 8181 24-JUN-1996
                    7777                   33                 8181 02-DEC-1991
                    7777                   33                 8181 01-MAR-2002
                    9999                   44                 9191 05-MAR-1980
                    9999                   55                 9191 06-MAR-1989
    12 rows selected.
    SQL> delete employees
      2  where  rowid in
      3           (select rowid
      4            from
      5            (
      6               select empno
      7                     ,job_no
      8                     ,start_date
      9                     ,row_number() over (partition by empno, job_no order by start_date) rn
    10               from   employees
    11               where  job_no = 8181
    12            )
    13            where rn > 1
    14           )
    15  ;
    4 rows deleted.
    SQL> select * from employees;
                   EMPNO             DIVISION               JOB_NO START_DATE
                    1111                   11                 8181 10-APR-1999
                    2222                   11                 3131 11-MAY-2005
                    3333                   44                 8181 08-JUN-1988
                    5555                   11                 8066 01-JAN-2001
                    6666                   33                 9600 01-JAN-1999
                    7777                   33                 8181 02-DEC-1991
                    9999                   44                 9191 05-MAR-1980
                    9999                   55                 9191 06-MAR-1989
    8 rows selected.

  • How to delete multiple rows from ADF table

    How to delete multiple rows from ADF table

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • Deleting a row from a table control through right-clic​k menu

    I have a table control. I want to delete a row from it when a user right clicks on a particular row and selects "Delete row" menu item. I have managed the creation of menu item but have not been able to delete the row which is right clicked and the menu item "Delete row" is selected. Guidance required! Thanks!

    smercurio_fc wrote:
    It's irrelevant whether the table is a control or indicator. See attached VI.
    Hi smercurio,
    please see the attached picture. In my previous post i mean the different in the menu. The red marked function is not available, if the table is an indicator. LV8.5!
    Mike
    Message Edited by MikeS81 on 04-18-2008 05:19 PM
    Attachments:
    Unbenannt.PNG ‏22 KB

  • Deleting a row from a table using jsp

    Given a table in a jsp, can an user click on a row of that table and retrieve the information so that the program can delete a record from a database table?
    most of the tables that I have seen are static, the user cannot interact with them(specially when the user wants to delete several records from a database table).
    Can anyone suggests a good book or way of deleting a row from table using jsp.

    eg use a column in the table that has a radio button or check box,
    on submit, get all the rows that are checked, using the row as an index into your db store, get the key and use the key to issue the sql delete command.

  • Delete row from Advanced Table

    Hi,
    I'm trying to follow the Delete exercise to create a table with delete image for my project. We don't need to have switcher and confirm dialog as exercise does.
    My table only has three columns: fromDate, endDate and delete.
    I got issue if I entered two dates value then click delete image immediately, then pageContext.getParameter("fromDate") and getParameter("endDate") will return empty string.
    I have to click Add another row to reload page then getParameter will return values.
    How do I resolve this issue?
    Thanks in advance!
    KJ

    One approach is to manually empty the fields. But a better approach will be to include an action button on each row to clear the entries programmatically.
    --Shiv                                                                                                                                                                                                                                                                                                                                           

  • Deleting Row from Advanced Table Region

    Dear Members,
    I have an OAF Page where I am using Advanced Table Region to display the data of a table.
    As soon as the page opens I am displaying one line in Advanced Table Region. In this region I have also given a button called ADD ANOTHER ROW +(using the feature of ADVANCED TABLE COMPONENTS, FOOTER, TABLE FOOTER , ADD TABLE ROW)+.
    So when user clicks on this button a new row will be added. Now if user wants to delete it how to achieve this.
    Kindly please help me in achieving this functionality.
    Many thanks in advance.
    Best Regards,
    Arun Reddy D.

    Hi Arun,
    First you need to create a button or image called Delete on your Advanced table region.
    Action Type : firePartialAction
    Event: delete
    Then In your CO PFR , write the below code
        if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
          String rowRef = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
          OARow row = (OARow)am.findRowByRef(rowRef);
          row.remove();
        }Hope this helps. :)
    Thanks,
    SK
    Edited by: SK on Feb 9, 2011 5:21 PM

  • Delete operation is not working to delete selected row from ADF table

    Hi All,
    We are working on jdev 11.1.1.5.3. We have one ADF table as shown below. My requirement is to delete a selected row from table, but it is deleting the first row only.
    <af:table value="#{bindings.EventCalendarVO.collectionModel}" var="row"
    rows="#{bindings.EventCalendarVO.rangeSize}"
    emptyText="#{bindings.EventCalendarVO.viewable ? applcoreBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET : applcoreBundle.TABLE_EMPTY_TEXT_ACCESS_DENIED}"
    fetchSize="#{bindings.EventCalendarVO.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.EventCalendarVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.EventCalendarVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t2" partialTriggers="::ctb1 ::ctb3"
    >
    To perform delete operation i have one delete button.
    <af:commandToolbarButton
    text="Delete"
    disabled="#{!bindings.Delete.enabled}"
    id="ctb3" accessKey="d"
    actionListener="#{AddNewEventBean. *deleteCurrentRow* }"/>
    As normal delete operation is not working i am using programatic approach from bean method. This approach works with jdev 11.1.1.5.0 but fails on ver 11.1.1.5.3
    public void deleteCurrentRow (ActionEvent actionEvent) *{*               DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    // Get an object representing the table and what may be selected within it
    ViewObject eventCalVO = dcItteratorBindings.getViewObject();
    // Remove selected row
    eventCalVO.removeCurrentRow();
    it is removing first row from table still. Main problem is not giving the selected row as current row. Any one point out where is the mistake?
    We have tried the below code as well in deleteCurrentRow() method
    RowKeySet rowKeySet = (RowKeySet)this.getT1().getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.getT1().ggetValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    rowData.getRow().remove();
    The same behavior still.
    Thanks in advance.
    Rechin
    Edited by: 900997 on Mar 7, 2012 3:56 AM
    Edited by: 900997 on Mar 7, 2012 4:01 AM
    Edited by: 900997 on Mar 7, 2012 4:03 AM

    JDev 11.1.1.5.3 sounds like you are using oracle apps as this not a normal jdev version.
    as it works in 11.1.1.5.0 you probably hit a bug which you should file with support.oracle.com...
    Somehow you get the first row instead of the current row (i guess). You should debug your code and make sure you get the current selected row in your bean code and not the first row.
    This might be a problem with the bean scope too. Do you have the button (or table) inside a region? Wich scope does the bean have?
    Anyway you can try to remove the iterator row you get
    public void deleteCurrentRow (ActionEvent actionEvent) { DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("EventCalendarVOIterator");
    dcItteratorBindings.removeCurrentRow();Timo

  • Deleting 1 row from a table takes too long...why?

    We are running the following query...
    delete gemdev.lu_messagecode where mess_code ='SSY'
    and it takes way too long as there is only 1 record in this table with SSY as the mess_code.
    SQL> set timing on;
    SQL> delete gemdev.lu_messagecode where mess_code ='SSY';
    1 row deleted
    Executed in 293.469 seconds
    The table structure is very simple as you can see below.
    CREATE TABLE GEMDEV.LU_MESSAGECODE
    MESS_CODE VARCHAR2(3) NOT NULL,
    ROUTE_CODE VARCHAR2(4) NULL,
    REPORT_CES_MNEMONIC VARCHAR2(3) NULL,
    CONSTRAINT SYS_IOT_TOP_52662
    PRIMARY KEY (MESS_CODE)
    VALIDATE
    ORGANIZATION INDEX
    NOCOMPRESS
    TABLESPACE IWORKS_IOT
    LOGGING
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE(BUFFER_POOL DEFAULT)
    PCTTHRESHOLD 50
    NOPARALLEL
    ALTER TABLE GEMDEV.LU_MESSAGECODE
    ADD CONSTRAINT LU_ROUTECODE_FK3
    FOREIGN KEY (ROUTE_CODE)
    REFERENCES GEMDEV.LU_ROUTECODE (ROUTE_CODE)
    ENABLE
    ALTER TABLE GEMDEV.LU_MESSAGECODE
    ADD CONSTRAINT MSGCODE_FK_CESMNEMONIC
    FOREIGN KEY (REPORT_CES_MNEMONIC)
    REFERENCES GEMDEV.SYS_CESMNEMONIC (CES_MNEMONIC)
    ENABLE
    My explain reads as follows.
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | DELETE STATEMENT | | | | 1 (100)| |
    | 1 | DELETE | LU_MESSAGECODE | | | | |
    | 2 | INDEX UNIQUE SCAN| SYS_IOT_TOP_52662 | 1 | 133 | 1 (0)| 00:00:01 |
    Also in my AWR Sql Report I see this as well
    Plan Statistics DB/Inst: IWORKSDB/iworksdb Snaps: 778-780
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
    into the Total Database Time multiplied by 100
    Stat Name Statement Per Execution % Snap
    Elapsed Time (ms) 521,102 N/A 12.0
    CPU Time (ms) 73,922 N/A 5.1
    Executions 0 N/A N/A
    Buffer Gets 2,892,144 N/A 3.4
    Disk Reads 2,847,609 N/A 8.6
    Parse Calls 1 N/A 0.0
    Rows 0 N/A N/A
    User I/O Wait Time (ms) 475,882 N/A N/A
    Cluster Wait Time (ms) 0 N/A N/A
    Application Wait Time (ms) 0 N/A N/A
    Concurrency Wait Time (ms) 2 N/A N/A
    Invalidations 1 N/A N/A
    Version Count 1 N/A N/A
    Sharable Mem(KB) 45 N/A N/A
    Now, since the table only has 150 rows, and I am only try to delete 1 row, why is there so much disk read and why does it take 5 minutes to delete? This just weird. Does this have something to do with the Child tables?

    Any triggers on the table?
    If you trace the session, what statement(s) seem to
    be taking all that time?
    JustinWell I traced my session and I noticed that my query does take a while, but I also noticed several other queries that I was not running. Not too sure where it came from. Have a look below. It is a sample from my TKPROF utility report.
    delete gemdev.lu_messagecode
    where
    mess_code ='SSY'
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.01 0.04 0 2 23 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.01 0.04 0 2 23 1
    Misses in library cache during parse: 1
    Optimizer mode: FIRST_ROWS
    Parsing user id: 57
    Rows Row Source Operation
    1 DELETE LU_MESSAGECODE (cr=3446672 pr=3442028 pw=0 time=309363335 us)
    1 INDEX UNIQUE SCAN SYS_IOT_TOP_52662 (cr=2 pr=0 pw=0 time=35 us)(object id 52663)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 35.87 35.87
    select /*+ all_rows */ count(1)
    from
    "GEMDEV"."TBLCLAIMCHARGE" where "CONTRACT_FEE_MESS_CODE" = :1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 10.53 44.95 381779 382893 0 1
    total 3 10.53 44.95 381779 382893 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=382893 pr=381779 pw=0 time=44953436 us)
    0 TABLE ACCESS FULL TBLCLAIMCHARGE (cr=382893 pr=381779 pw=0 time=44953403 us)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file scattered read 47795 0.03 37.87
    db file sequential read 101 0.00 0.02
    select /*+ all_rows */ count(1)
    from
    "GEMDEV"."TBLCLAIMCHARGE" where "FEE_INEL_MESS_CODE" = :1

Maybe you are looking for

  • How to create a passsword protection for EXCEL file

    Hi, I have created EXCEL, CSV and DBF file generation through Oracle PL/SQL. Now my client expecting to create a password protection. Can anyone tell me how to create a passsword protected file? Cheers, San

  • Why returning string from java stored function failed ?  HELP ME, PLEASE

    Hi everybody, I created java stored function: it's doing http post, parsing xml from http reply, and returning string result. Sometimes, it doesn't return any value. What can be a reason ? The high level procedure, has following form: class SBE { pub

  • APCC -Scenario Cost Summary  report

    HI, I am a newbie in APCC. When i navigate to Supply Chain Analyst -> Scenario Analysis -> Scenario Cost Summary  report 1) I would want to know what is the underlying logic behind this report 2)How is the column 'Transportation Costs' is getting com

  • Third party apps not launching

    I'm at my wit's end with this. I would like to preface this by saying I've searched through the forums for an resolution to this problem to no avail. I am using both the current version of the iPhone and iTunes software. I get various error messages

  • File deletion

    I continued to look for the file, but could not find it. I open norton utilities and deleted all the temp files in my computer. Although I could not find it, the offending file was deleted. Now, when I open reader, the pdf file still shows up in "ope