logical delete cascade

Hello

I need to implement the logic cascade delete (defining a column instead of remove value)

Simple logical deletion, I made by substituting the EntityImpl remove() method.
    public void remove() {
        setAttribute("Status","1");
    }
but with this stunt declarative removal does not work.

So I'm looking for some advice how to solve this problem.

I don't know if it's the best way, but it works :)

    /**Add entity remove logic in this method.
     */
    public void remove() {

        setCountryName(getCountryName() + "Remove-Deleted");
        super.remove();
    }

    /**Custom DML update/insert/delete logic here.
     */
    protected void doDML(int operation, TransactionEvent e) {
        if (operation != DML_DELETE)
            super.doDML(operation, e);
        else {
            super.doDML(DML_UPDATE, e);
        }

    }

Tags: Oracle

Similar Questions

  • Alternate DELETE CASCADE

    Hi all

    I have a situation where I need to delete a record in the parent table. But I must find the child records, delete these records and then delete the record in the parent table.

    To understand, I'm using EMP, DEPT tables here.
    I have Emp and Dept tables. Let's say we have not "we delete cascade" & I don't want to use table constraints to find the parent-child relationship, because it takes a long time.
    I want to delete a record from table DEPT where deptno = 10.
    But we can do that only after the removal of all the documents that testify the deptno = 10 in the EMP table.
    I have the answer, I use all_constarints table to find the primary key of the EMP table and delete the records.

    Other options?

    THX
    Rod.

    Hello

    SamFisher wrote:
    Frank,
    I'm not supposed to change the structure of the table to use ON DELETE CASCADE. It is a Production of data.

    A reason any prevents you from changing the constraints should stop you from writing you own alternative. It is true that implementation and using of ON DELETE CASCADE can cause serious problems such as accidentally deleting valid records. Register your own alternative will have the same problems and much more.
    I do not mean you are a bad programmer, or that you don't test things carefully, but you're better than the team of Oracle who wrote and tested ON DELETE CASCADE? You will have the resources to maintain your code better that Oracle maintains its code?

    You want to be very careful with production data. That's why you should use the best tools available to deal with him.

  • delete cascade question

    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production-
    given the following scenario an array of great grandparent, grandparent table/s, parent table/s, children table/s
    with deletions cascade.
    so something like.
    CREATE TABLE T1
    (
       T1_id   NUMERIC (10) NOT NULL,
       CONSTRAINT T1_pk PRIMARY KEY (T1_id)
    );
    
    CREATE TABLE T2
    (
       T2_id   NUMERIC (10) NOT NULL,
       T1_id   NUMERIC (10) NOT NULL,
       CONSTRAINT T2_pk PRIMARY KEY (T1_id, T2_id),
       CONSTRAINT fk_T1 FOREIGN KEY
          (T1_id)
           REFERENCES T1 (T1_id) ON DELETE CASCADE
    );
    
    CREATE TABLE T3
    (
       T3_id   NUMERIC (10) NOT NULL,
       T2_id   NUMERIC (10) NOT NULL,
       T1_id   NUMERIC (10) NOT NULL,
       CONSTRAINT T3_pk PRIMARY KEY (T1_id, T2_id, T3_id),
       CONSTRAINT fk_T2 FOREIGN KEY
          (T1_id, T2_id)
           REFERENCES T2 (T1_id, T2_id) ON DELETE CASCADE
    );
    
    CREATE TABLE T4
    (
       T4_id   NUMERIC (10) NOT NULL,
       T3_id   NUMERIC (10) NOT NULL,
       T2_id   NUMERIC (10) NOT NULL,
       T1_id   NUMERIC (10) NOT NULL,
       CONSTRAINT T4_pk PRIMARY KEY (T1_id, T2_id, T3_id, T4_id),
       CONSTRAINT fk_T3 FOREIGN KEY
          (T1_id, T2_id, T3_id)
           REFERENCES T3 (T1_id, T2_id, T3_id) ON DELETE CASCADE
    );
    now every night runs a delete statement, where some T1 lines are deleted
    delete from T1 where blah blah blah
    so all the cascading deletes are performed.

    It is faster to remove from the table below / (s) in the case of T4, then delete the T3, then T2 and T1 finally
    or leaving the cascade deletes do their thing results in the same amount of time?

    If it's faster to remove from the table below / (s) is first of all a few querry which gave a table I can find all the
    its deletion tables cascading? so, in my particular case T1 he would show as the weaker then T3 and T2 T4.

    Thanks for any input.

    Hello

    Pollywog wrote:
    ... It is faster to remove from the table below / (s) in the case of T4, then delete the T3, then T2 and T1 finally
    or leaving the cascade deletes do their thing results in the same amount of time?

    Interesting question. Try (using tables) and see.

    My guess is that it would be faster to just delete T1. Say you delete T2 and T1. When you delete T1, it will check if there are children in T2, so the effort you put into the search for the children in T2 is redundant.

    If it's faster to remove from the table below / (s) is first of all a few querry which gave a table I can find all the
    its deletion tables cascading? so, in my particular case T1 he would show as the weaker then T3 and T2 T4.

    Data dictionary views all_constraints and all_cons_columns (as well as their counterparts from user_ and dba_) have this information.

  • Add ON DELETE CASCADE

    Hello world.

    I want to add the "ON DELETE CASCADE" constraint on the foreign key value in the child table as.

    ALTER table employees
    Add CONSTRAINT cscade_dept_no ON DELETE CASCADE (Deptno)

    but it displays the error message, so please help me in this matter.


    Thank you

    Published by: BilalKhan on February 7, 2011 23:53

    In general, will be useful look the displayed error.

    Example:

    ALTER table employee Add CONSTRAINT cscade_dept_no ON DELETE CASCADE (Deptno);
    
    Error SQL: ORA-00904: :
    00904. 00000 -  "%s: invalid identifier"
    *Cause:
    *Action:
    

    Then we can tell you... Your syntaxis is incorrect, you must use

    ALTER TABLE table_name
    Add CONSTRAINT constraint_name
    FOREIGN KEY (column1, column2,... column_n)
    REFERENCES parent_table (column1, column2,... column_n)
    WE DELETE CASCADE;

    example of

    ALTER TABLE employee
    add CONSTRAINT cscade_dept_no
      FOREIGN KEY (Deptno)
      REFERENCES Department (Deptno)
      ON DELETE CASCADE;
    
  • Cannot delete the Parent folder - On Delete Cascade is set

    Hi all
    I have a table parent and child, and when I try to delete the parent record, I get the following error:

    ORA-02292: integrity constraint (WFSTEADMAN. INCIDENT_NOTES_TBL_FK) violated - book of the foundling
    Error failed to process row in the MYTEST_INCIDENTS table.

    I have the FK is defined on the ON DELETE CASCADE, so I'm not sure of what could be the issue.

    Here are the structures of my parent and child tables:

    I use apex.oracle.com for the version is: Application Express 4.0.2.00.06

    Any help would be appreciated.
    Wally

    PARENT TABLE:
    =============================================================

    CREATE TABLE 'MYTEST_INCIDENTS '.
    (ACTIVATE THE "INCIDENTID" NUMBER NOT NULL,)
    "INCIDENTCREATED" DATE NOT NULL ACTIVATE.
    ACTIVATE THE "INCIDENT_OWNER" VARCHAR2 (200) NOT NULL,
    "DTGSTART" DATE NOT NULL ACTIVATE.
    DATE OF THE "DTGEND."
    VARCHAR2 (4000) "INCIDENT_SERVICES."
    VARCHAR2 (4000) "INCIDENT_CUSTOMERS."
    VARCHAR2 (4000) "INCIDENT_DESCRIPTION."
    VARCHAR2 (4000) "INCIDENT_TIMELINE."
    VARCHAR2 (500) "INCIDENT_TRACKING."
    VARCHAR2 (4000) "INCIDENT_RESTORE."
    VARCHAR2 (4000) "INCIDENT_FOLLOWUP."
    NUMBER OF "INCIDENT_LEVEL."
    VARCHAR2 (500) "INCIDENT_TITLE."
    VARCHAR2 (4000) "EMAIL_NOTIFY."
    VARCHAR2 (4000) "TEXT_NOTIFY."
    VARCHAR2 (25) "LEVEL_TYPE."
    ENABLE 'MYTEST_INCIDENTS_PK' CONSTRAINT PRIMARY KEY ('INCIDENTID')
    ) ;


    CREATE OR REPLACE TRIGGER "BI_MYTEST_INCIDENTS".
    Before Insert on 'MYTEST_INCIDENTS '.
    for each line
    Start
    If: NEW. "' INCIDENTID ' is null then
    Select 'MYTEST_INCIDENTS_SEQ'.nextval in: NEW. "' INCIDENTID ' from dual;
    end if;
    end;
    /
    ALTER TRIGGER 'BI_MYTEST_INCIDENTS' ENABLE;


    CHILD TABLE
    =============================================================

    CREATE TABLE 'MYTEST_INC_NOTES '.
    (ENABLE THE "NOTEID" NUMBER NOT NULL,)
    ACTIVATE THE "INCIDENT_ID" NUMBER NOT NULL,
    DATE OF THE "NOTE_DTG."
    VARCHAR2 (200) "NOTE_OWNER."
    VARCHAR2 (4000) "NOTE_COMMENTS."
    ENABLE 'MYTEST_INC_NOTES_PK' CONSTRAINT PRIMARY KEY ('NOTEID")
    ) ; ALTER TABLE 'MYTEST_INC_NOTES' ADD 'MYTEST_INC_NOTES_CON' OF CONSTRAINT FOREIGN KEY ('INCIDENT_ID')
    REFERENCES "MYTEST_INCIDENTS" ("INCIDENTID") ON DELETE CASCADE ACTIVE;


    CREATE OR REPLACE TRIGGER "BI_MYTEST_INC_NOTES".
    Before Insert on 'MYTEST_INC_NOTES '.
    for each line
    Start
    If: NEW. "" NOTEID ' is null then
    Select 'MYTEST_INC_NOTES_SEQ'.nextval in: NEW. "" NOTEID ' from dual;
    end if;
    end;
    /
    ALTER TRIGGER 'BI_MYTEST_INC_NOTES' ENABLE;


    CREATE OR REPLACE TRIGGER "MYTEST_INC_NOTES_T1".
    FRONT
    Insert or update on 'MYTEST_INC_NOTES' REFERENCING NEW AS NEW OLD AS OLD
    for each line
    Start
    : NEW. NOTE_DTG: = SYSDATE;
    end;
    /
    ALTER TRIGGER 'MYTEST_INC_NOTES_T1' ACTIVE;

    I suppose that you use the provided script to create your tables:
    the error message indicates that the FK INCIDENT_NOTES_TBL_FK is vioalated
    And your script creates a cascade of delete on FK MYTEST_INC_NOTES_CON

  • Problems with the database, on delete cascade

    Hello

    I am in a project with the Flahs CS4 with air and as3. I create a database by code, everything is ok. I have 2 tables,
    a main table with a code field as primary key and other details of the table, named e.g. DetailTable, with 3 fields as the primary key. What I want to do, this is a deletion of a row in MainTable, all lines of DetailTable, where the field code is the same as the field in MainTable code should be deleted also.

    Here's the SQL code to create the tables.

    var sql2:String = "CREATE TABLE If NOT EXISTS MainTable ('+ '.
    "code INTEGER PRIMARY KEY AUTOINCREMENT, ' +.
    "quote," +
    'date ' +.
    "  " +
    ")";

    var sql3:String = "CREATE TABLE If NOT EXISTS DetailTable ('+ '.
    "code INTEGER, INTEGER position, type INTEGER, ' +.
    "path of TEXT, TEXT document, ' +.
    'PRIMARY KEY (code, position, type) +.
    'FOREIGN KEY (code) REFERENCES Detallesecuencia (code) ON DELETE CASCADE ' +.
    ")";


    Thus, when the tables are created, insert data. I connect without a problem, remove a line in MainTable (see code), to remove the line with the example code = 4, but in the DetailTable, all with code = 4 lines are NOT deleted, why?

    [CODE]
    Inside of a class

    private var conn: SQLConnection;

    public void constructorClass() {}
    Conn = new SqlConnection ();
    ConexionBD();
    }

    function ConexionBD() {}

    conn.addEventListener (SQLEvent.OPEN, openHandler);
    conn.addEventListener (SQLErrorEvent.ERROR, errorHandler);
    var dbFile:File = File.applicationDirectory.resolvePath ("mydatabase.db");
    conn.openAsync (dbFile, SQLMode.UPDATE);
    }

    function deleteRow() {}
    selectData:SQLStatement = new SQLStatement();
    selectData.sqlConnection = conn;
    selectData.text = "" DELETE FROM MainTable WHERE code =: param1 ";"
    selectData.addEventListener (SQLEvent.RESULT, resultHandler);
    selectData.addEventListener (SQLErrorEvent.ERROR, errorHandler);

    Delete line in MainTable code = 4, but not to delete all the rows in DetailTable with code = 4
    selectData.parameters [": param1"] = 4;

    selectData.execute ();
    }
    [/ CODE]

    Thanks in advance

    Hmmm, well then maybe it's you must go down the road of the old school and delete individual tables as needed, rather than rely on the cascade delete.

  • Foreign keys without ON DELETE CASCADE; Database design question

    It's the 3rd company, while I work, where I see that created foreign keys
    ON DELETE CASCADE
    clause.
    My colleague said that it is created without the ON DELETE CASCADE clause in order to complicate the deletion of data (records of children). Thus, for codes of the Purge and archive, before we delete the parent table we must remove from the child table first.

    Occasinaly, something is wrong and we will end up disabling FKs make them all and then purging, archiving, etc...

    So, is it not better to create foreign keys with the clause ON DELETE CASCADE, rather than having all these hassles?

    Experience, no matter what you think?

    Personally, I am firmly in the removal of the brand of hard data camp. In the vast majority of cases, trying to remove an active parent is an error if the user must be informed of what they are trying to do and must make a conscious effort to do so (in other words, remove first the children).

    John

  • Logical deletion GTC

    Hello!

    I created a connector to the supply of a table in a database (GTC).
    I need to perform a logical deletion in the table when I revoke a resource (make a mark on the record in the table without deleting it physically)
    How can I do this?

    Thank you!

    You can get the same thing follows below steps.

    1. create a custom, task to change the attribute
    2. set this task on cancellation to create the task of the user
    3. the success of step 1 set the State of the resources to revoked.

    Hope this helps,
    Sam

  • ON DELETE CASCADE and the CASCADE CONSTRAINTS - what are the difference?

    I know that CASCADE CONSTRAINTS would allow me to remove the parent key and the reference of the following children will be freed from the constraints. However, the child columns will remain and will be set to NULL.

    SO:

    If the CASCADE CONSTRAINTS could do the job, why do we need on REMOVE CONSTRAINTS?

    Unnecessary extra Note:

    I know that YOU DELETE CONSTRAINT is defined with the child. When I tried to delete the parent key without having the CONSTRAINTS of the WATERFALL, I got an error message indicates that the parent key has childs! So ON DELETE CASCADE was not up to what I had to mention the CASCADE CONSTRAINTS when deleting the parent key while the CASCADE CONSTRAINTS worked fine without ON DELETE CASCADE on the side of the child.

    I hope that my question is simple...

    A foreign key with a delete cascade means that if a record in the parent table is deleted, then the corresponding records in the child table with automatically deleted. This is a deletion of the waterfall.

    Forced to cascade deletes all foreign keys that reference the table to remove, and then deletes the table.

  • On DELETE CASCADE

    Y at - it a syntax that will allow me to change a constraint to be a sur-supprimer-cascade, without having to drop and re-create me?

    10.2.0.4 on Windows 64-bit.

    I don't expect that there is, but it would be nice to be surprised!

    If not, does anyone have a pure piece of PL/SQL that would do the deed to an entire schema programmatically?

    Kamran Agayev A. wrote:
    Run this code

    SELECT    'select DBMS_METADATA.get_dependent_ddl (''REF_CONSTRAINT'','''
    || table_name
    || ''') code
    FROM DUAL
    UNION ALL
    SELECT DBMS_METADATA.get_dependent_ddl (''CONSTRAINT'','''
    || table_name
    || ''')
    FROM DUAL;
    ' code
    FROM dba_tables
    

    Keita,

    Why is there a colon, semi with FROM DUAL ? That ends the statement and the next line is throwing the error I think!

    Catfive,

    I have run that had no oracle db here, but try this.

    SELECT 'select DBMS_METADATA.get_dependent_ddl (''REF_CONSTRAINT'','''|| table_name|| ''') code
      FROM DUAL
    UNION ALL
    SELECT DBMS_METADATA.get_dependent_ddl (''CONSTRAINT'','''|| table_name|| ''')  FROM DUAL' code
      FROM dba_tables
    

    Aman...

  • Cascading deletes

    Hello

    We used alter table to change the cascading delete constraint. There are two options. What is different between the two of them.

    Example:

    (1) Alter table t3 add constraint t2_F foreign key (id) makes reference to t2 (id, column2, column3) on delete cascade.

    or

    (2) Alter table t3 add constraint t2_F foreign key (id) makes reference t2 on delete cascade.

    I know that this column special first will set delete cascade.

    What is the use of a second, in this case we do not use the name of the column in ' foreign key (id) refers to Q2 we delete cascade;

    > 1) Alter table add constraint t2_F foreign key (id) t3 refers to t2(id,column2,column3) on delete cascade.

    http://docs.Oracle.com/CD/E11882_01/server.112/e41084/clauses002.htm
    =====
    Foreign key constraints
    You can designate the same column or combination of columns as a foreign key and a primary or unique key.
    =====

    (> 2) Alter table t3 add constraint t2_F foreign key (id) makes reference t2 on delete cascade.

    http://docs.Oracle.com/CD/E11882_01/server.112/e41084/clauses002.htm

    =====

    Foreign key constraints
    If you have identified only the parent table or view and omit the column name, then the foreign key references the primary key of the parent table or view automatically.

    =====

  • How to specify SQL custom querying the db with option to delete logical adapter

    Hi all

    I write a composite SOA application using JDeveloper SOA Suite 11.1.1.4 connection to a SQL Server database with the help of a Secretary of the poll the DB adapter with the logical delete option to send data to a BPEL process.

    I have requirements that go beyond what is supported in the UI JDeveloper for polling of the adaptor DB options, namely:
    * update several columns to mark each line read, and
    * specify different SQL to remove operation logic based on if bpel surveyed data processing was successful or not.
    A complicating factor is that the query contains two tables. Here is my complete use case:

    (1) mark will select data from two tables: for example 'headers' and 'details' simplified for this example:
    Table: headers
    HID - primary key
    name - plate
    status - "raw", "transformed" or "error".
    processedDate - null when the data is loaded, the DateTime current when the treatment of the line
    Table: Details
    HID - foreign key pointing header.hid
    attr - name attribute of data
    value - value of the attribute data

    2) there are a many relationship: 1 from detail lines to the header through the hidden columns. The adapter db SELECT the voting clerk must return results of an outer join consisting of line a header and the associated detail rows where header.status = 'no' and header.hid = details.hid. (This is supported by the UI Jdeveloper)

    (3) the survey data will be sent to be processed by a bpel process:
    (3.1) if the bpel treatment is successful, the logical delete operation (UPDATE) must set header.status = 'transformed' and header.processedDate = 'getdate() '.
    (3.2) if bpel treatment fails (for example hits a data error during the processing of the selected data) the logical delete operation (UPDATE) must be set to 'impossible' = header.status, header.processedDate = 'getdate()' and header.errorMsg = '{of the text returned by bpel}.

    Several parts of the #3 are not supported by the UI JDeveloper: update several columns to mark the addressed line, using getdate() to fill a value of one of these updates to the column, update of different operations based on the results of the BPEL, processing of the data (success or error) and using data from BPEL treating it as a value of these updates of column (error message).

    I found examples that describe the specification that is customized by using querying SQL Delete option to create a template and then modify the toplink files to specify custom select and update SQL to implement a logical deletion. (for example, http://dlimiter.wordpress.com/2009/11/05/advanced-logic-in-oracle-bpel-polling-database-adapter/ and http://myexperienceswithsoa.blogspot.com/2010/06/db-adapter-polling-tricks.html). But none of them match what I have in my project, in the first case because maybe because I use a newer version of JDeveloper and the second I think because in my case, two tables are involved.

    Any suggestion would be appreciated. Thank you, John

    Hi John,.

    You raised a good script.
    First of all, let me say that the purpose of the DB of the election operation, is to have an option to start the process of a DB table/view and not update several fields in a table (or have other complex manipulations on the table).
    Thus, when choose update a field in a record, after reading it, you "say" the engine not to question this record again. Of course, I guess you can find a solution/workaround for it, but I don't think that this is the way...

    The question now is what to do?
    You can have another DB adapter where you can update the data after you have completed the process. In this case, after reading the data (on the query operation) - updated the "transformed" for example = header.status and after processing the selected data update the rest fields.

    Hope it make sense for you.

    Arik

  • Why is not cascade delete works correctly?

    With the help of JDev 11.1.2.1.0.

    Error: ORA-02292: integrity constraint (CINDER. QR_DCMR_FK) violated - book of the foundling.

    I have a relationship of the master / detail. The association is composite and the operation "Optimize for Cascade Delete" is checked. In my AppModule, I call a function that deletes a master record. ADF automatically deletes the dependent lines.

    However, when I submit to the database, I get the message. I don't get this error when I commit new master/detail records, only when I change a pre-existing.

    On another note, I always the same error when I put the foreign key in database initially postponed.

    What could cause such behavior?

    "Optimize for delete cascade of database" is intended to be used when you have a foreign key (FK) in the database that is defined with the CASCADE DELETE option. ADF What if selected is with 2 EOs joined by a composition association, if the user deletes a record of primary OS, at the time rather sends deletions to registration of primary OA and children associated with EO records separately (which could be much separate DELETE statement), it sends only a simple omission to EO primary record. This is based on the assumption that FK with the CASCADE DELETE option in the database automatically removes the child records, thus saving the separate children removal instructions.

    See the last sentence of article 4.10.13.4 of the merger Guide: http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcentities.htm#BABHFJFJ

    As these only use this option if your CONCRETE. QR_DCMR_FK has the DELETE CASCADE option in your database.

    If this isn't your use case, please explain what you are trying to reach.

    CM.

  • Cascading deletion

    I activated on option delete cascade in a single table. What I want is when I delete a row in the AUDIT_PROCESS table, it deletes the row in the FEEDBACK_PROCESS table and the table MICC_AT_ANALISYS. I think I created the constraints on the table to foreign keys feedback_cod and cod_analysis very well audit_process, but when I delete a row in the audit_process table, it doesn't delete the table feeback_process and micc_at_analysis. I don't know if I have to make another step to trigger what I want. Please help me with this.

    Here's the code when I created the tables.

    I have this table with cascading delete enabled
    CREATE TABLE  "AUDIT_PROCESS" 
       (     "AUDIT_COD" NUMBER(5,0), 
         "COD_ANALYSIS" VARCHAR2(5), 
         "FEEDBACK_COD" NUMBER, 
         "AUD_SR" VARCHAR2(15), 
         "AUD_ERROR" VARCHAR2(5), 
         "AUD_OBSERV" VARCHAR2(300), 
         "AUD_OWNER" NUMBER, 
         "AUD_DATE" VARCHAR2(10), 
         "AUD_STATUS" VARCHAR2(5), 
          CONSTRAINT "AUDIT_PROCESS_PK" PRIMARY KEY ("AUDIT_COD") ENABLE
       ) ;ALTER TABLE  "AUDIT_PROCESS" ADD CONSTRAINT "AUDIT_PROCESS_CON" FOREIGN KEY ("COD_ANALYSIS")
           REFERENCES  "MICC_AT_ANALISYS" ("COD_ANALYSIS") ON DELETE CASCADE ENABLE;ALTER TABLE  "AUDIT_PROCESS" ADD CONSTRAINT "AUDIT_PROCESS_CON_FEEDBACK" FOREIGN KEY ("FEEDBACK_COD")
           REFERENCES  "FEEDBACK_PROCESS" ("FEEDBACK_COD") ON DELETE CASCADE ENABLE;
    This table below is one of the parents table
    CREATE TABLE  "FEEDBACK_PROCESS" 
       (     "FEEDBACK_COD" NUMBER, 
         "FEEDBK_AGREE" VARCHAR2(2), 
         "FEEDBK_OBSERV" VARCHAR2(250), 
         "FEEDBK_DATE" VARCHAR2(10), 
         "FEEDBK_STATUS" VARCHAR2(5), 
         "SR" VARCHAR2(15), 
         "ERROR" VARCHAR2(5), 
          CONSTRAINT "FEEDBACK_PROCESS_PK" PRIMARY KEY ("FEEDBACK_COD") ENABLE
       ) ;
    It's the other parent table
    CREATE TABLE  "MICC_AT_ANALISYS" 
       (     "COD_ANALYSIS" VARCHAR2(5), 
         "ANALISYS_DATE" VARCHAR2(150), 
         "ANALYSIS_OBS" VARCHAR2(150), 
         "ANALYSIS_STATUS" VARCHAR2(4), 
         "ANALYSIS_SOURCE" VARCHAR2(10), 
         "ANALYSIS_ERROR" VARCHAR2(4), 
          CONSTRAINT "MICC_AT_ANALISYS_PK" PRIMARY KEY ("COD_ANALYSIS") ENABLE
       ) ;

    Bernardo,

    This isn't a typical question of APEX.

    Suggested it was an option.

    CREATE OR REPLACE TRIGGER trg_adr_audit_process
      AFTER DELETE ON audit_process
      FOR EACH ROW
    BEGIN
      DELETE feedback_process WHERE feedback_cod = :old.feedback_cod;
      DELETE micc_at_analisys WHERE cod_analysis = :old.cod_analysis;
    END;
    

    However, if it is in the APEX, you might consider writing a page-process that manages all delete them for you:
    -remove the child
    -remove the parent
    and this process will be triggered by the action of DELETING your page.

    Kind regards
    Richard

  • How to hide the table row after deleting logical

    Hello.
    I use Jdeveloper 11.1.1.3.0, ADF BC and ADF Faces.
    I would like to implement the logic delete in my application.
    In my entity object I have deleted attribute and I replace the remove() method in my EntityImpl class.
        @Override
        public void remove()
        {
           setDeleted("Y");
        }
    and I added this condition in my view object
    WHERE NVL(Deleted,'N') <> 'Y'
    on my page, I have a table. This table has a column to remove each line. I dragged and drop action the data control RemoveRowWithKey
    and the value of the parameter * #{row.rowKeyStr} *.
    I have what I need is the following:
    When the user click on the delete button I want to hide the ROE of the table. I tried to rerun the query after deleting, but the line is still on the page. Why run query does not hide the line of the screen.
    Here's the code I used to remove and run queries
        public String deleteLogically()
        {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("removeRowWithKey");
            Object result = operationBinding.execute();
            DCBindingContainer dc=(DCBindingContainer) bindings;
            DCIteratorBinding iter=dc.findIteratorBinding("TakenMaterialsView4Iterator");
            iter.getCurrentRow().setAttribute("Deleted", "Y");
            //iter.getViewObject().executeQuery();
            iter.executeQuery();
            return null;
        }
    as you can see I used two methods () iter.getViewObject () .executeQuery; and iter.executeQuery (); but the result is the same.

    I built a sample for you - http://jobinesh.blogspot.com/2011/05/soft-deletion-of-rows.html. Please see if it meets your requirement.

Maybe you are looking for