ON CASCADE UPDATE  in ODI ?

Hello,
Does any one know if this works with Oracle as ODI shows this option in Model --> datastores --> constraints --> foreign key reference.
Thanks
Greenwich

Oracle doesn't intrinsically have the concept of a CASCADE UPDATE.
From a data modeling standpoint, primary keys should never, ever change under any circumstances. If a column can ever change, it should not be used as a primary key.
Tom Kyte has a package and some code to generate triggers that would do this sort of thing
http://asktom.oracle.com/~tkyte/update_cascade/index.html
but I would strongly suggest you change the data model rather than going down that path.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • How to cascade update

    how to cascade update?

    Sorry everyone for going regional with my Mexican fiend!
    In MEXMAN's first case, integrity on related data was already being enforced through a valid foreign key (TIZAYUCA.REGLAFAB_PRODUCTO_FK). However, the user wanted to update data included in the foreign key relationship. To acomplish this, I recommended to change the actual constraint state to defer validation until commit. Using the now familiar column names, the sentences are:
    ALTER TABLE TIZAYUCA.REGLA_FABRICACION
    DROP CONSTRAINT REGLAFAB_PRODUCTO_FK;
    ALTER TABLE TIZAYUCA.REGLA_FABRICACION
    ADD CONSTRAINT REGLAFAB_PRODUCTO_FK FOREIGN KEY (GRUPO, PRODUCTO)
    REFERENCES TIZAYUCA.PRODUCTO (GRUPO, CLAVE)
    INITIALLY DEFERRED;
    In MEXMAN's second case, a wholly new integrity needs to be enforced between two tables but some actual data present in both tables do not validate the desired constraint. The offending rows from the child table (TIZAYUCA.PRESENTACION) may be obtained executing
    SELECT *
    FROM tizayuca.presentacion t
    WHERE (t.grupo, t.producto) NOT IN
    (SELECT p.grupo, p.clave
    FROM tizayuca.producto p);
    MEXMAN has 3 choices:
    1. deleting the offending rows in the child table (TIZAYUCA.PRESENTACION) before executing
    alter table TIZAYUCA.PRESENTACION enable constraint PRES_PROD_FK;
    2. inserting the missing rows in the parent table (TIZAYUCA.PRODUCTO) before executing
    alter table TIZAYUCA.PRESENTACION enable constraint PRES_PROD_FK;
    3. making the new constraint ignore the present data and enforcing the relationship starting with new data:
    alter table TIZAYUCA.PRESENTACION
    add constraint PRES_PROD_FK foreign key (GRUPO, PRODUCTO)
    references TIZAYUCA.PRODUCTO (GRUPO, CLAVE)
    deferrable initially deferred
    enable novalidate;
    (drop the present PRES_PROD_FK constraint first)
    Please find more on the constraint topic here:
    http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10759/clauses002.htm#CJAFFBAA
    and here:
    http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10759/clauses002.htm#i1002273
    Best regards,
    Luis Morales,
    ConsiteNicaragua.com

  • Cascade update on tables

    Hi,
    I know that oracle apps coding standard prohibits cascade delete feature in the database. Hence it should be implemented at application level.
    However my question is regarding cascade update. Need is to update the header's WHO columns, when an update is made to any of the lines. Both the tables are custom tables. I was thinking to write a trigger, instead of putting this logic in application.
    What should be the better solution and why? Writing trigger or implementing this functionality in application (OAF).
    Abdul Wahid

    Hi Sandeep.
    Thanks for the answer.
    However its still half.
    Answer is considering putting the logic at application level,fine. but why?
    Question is about its benefits over putting the trigger on the lines table.
    Why I am favouring trigger is due to following reasons..
    1. Lesser maintenance. (Just one trigger, no code jungle)
    2. Update of header with line' WHO is always expected (from application or any concurrent program)
    3. And putting things in application, brings challenge of maintaining integrity constrains....
    This third point is main reason I am seeing behind oracle's statndard for cascade delete, cause they are seeded tables and putting a trigger on header table may delete lines rows always (Very specific to that screen), which may not be desirable in a lot cases.Huge integrity risk.
    This case is of update desirable always, where I am seeing using trigger as help to maintain integrity, instead of risk to integrity.
    Is there any doc about such situation( coding and design guidelines). I searched net and metalink, but yet did not find.
    (my application is OAF, and its implemented also by the grace of Allah.)
    Abdul Wahid

  • Best practice when doing large cascading updates

    Hello all
    I am looking for some help with tackling a fairly large cascading update.
    I have an object tree that needs to be merged using JPA and Toplink.
    Each update consists of 5-10000 objects with a decent depth as well.
    Can anyone give me some pointers/hints towards a Best practice for doing this? Looping though each object with JPA's merge takes minutes to complete, so i would rather not do that.
    I have never actually used TopLinks own API before, so i am especially interested if TopLink has an effective way of handling this, preferably with a link to some related reading material?
    Note that i have a somewhat duplicate question on (Noting for good forum practice)
    http://stackoverflow.com/questions/14235577/how-to-execute-a-cascading-jpa-toplink-batch-update

    Not certain what you think you can't do. Take a long clip and open it in the Viewer. Set In and Out points. Drop that into the Timeline. Now you can move along in the Viewer clip and set new Ins and Outs and drop that into the Timeline. Clips in the Timeline are created from the Ins and Outs you set in the Viewer.
    Is that what you want to do? If it is, I don't where making copies of the clip would work for you
    Later, if you want to match up a clip in the Timeline to that master clip, just use Match Clip (find) in the timeline to find where it correaltes to your main clip
    You can have FCE automatically create subclips at camera cut points by using DV Stop/Start Detect if that is what you're looking for

  • Cascade Update in Oracle Constraint ?

    How can I create a Constraint in Oracle 9i with Cascade Update Option like On Delete Cascade.
    It means, if I change the primary key of master table, the foreign key of all the relevant child tables should be updated automatically.
    Any idea please ?
    Best Regards,
    Luqman

    Oracle doesn't intrinsically have the concept of a CASCADE UPDATE.
    From a data modeling standpoint, primary keys should never, ever change under any circumstances. If a column can ever change, it should not be used as a primary key.
    Tom Kyte has a package and some code to generate triggers that would do this sort of thing
    http://asktom.oracle.com/~tkyte/update_cascade/index.html
    but I would strongly suggest you change the data model rather than going down that path.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Cascade update

    Is there a way in oracle to achive cascade update functionality just as cascade delete?

    It is possible
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:5773459616034
    However, as Tom indicates, it is a very bad practice. If you envision ever contemplating changing primary keys, you need a new primary key. A sequence-generated synthetic key column is an excellent choice if there is no natural key.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Cascade Update (Urgent)

    Dear Friends,
    I need to update the master records have records in details tables. Can anyone suggest me the feature of CASCADE UPDATE. So that moment i changed the master record it should reflect to detail records.
    I DON'T WANT TO USE CURSOR TO UPDATE RECORDS IN DETAILS.
    Thanks.

    Hi,
    You can try to use the pre-update, on-update, post-update trigger for the master-block. In that you can parse an update statement for the detail block. This will 'simulate' a cascade delete
    Hope this helps.

  • Updating PK with same value - effect on CASCADE UPDATE

    Hello,
    I would like to understand how sql server 2008 deals with cascade updates
    For example I have
    Parent table: Employee with column Id as varchar(20) primary key
    Child table with IdEmployee as varchar(20) foreign key
    I set up Cascade Update for those two tables, meaning any change to primary key in Employee table will cause update in child table rows that match affecting Id
    Scenario 1:
    Update Employee
    set Id = 'ABC',
    Name = 'something new'
    where Id = 'CCC'
    Result of child table: all rows with foreign key IdEmployee and value of 'CCC' are updated. Expected behavior.
    Scenario 2:
    Update Employee
    set Id = 'ABC',
    Name = 'something new 2'
    where Id = 'ABC'
    This time, i am doing something different. I am beside update of column Name with new value, also update primary key but
    with SAME value
    Question is: what is going to happen to child rows? Are they ALL going to UPDATE due to CASCADE UPDATE
    So far, what i did in order to find solution is:
    1. I put an timestamp column in child table that should update each time row gets updated
    2. I put a trigger for update event on child table that will write something to some log table
    *After I set up those two I ran example like above just to be sure timestamp gets changed as well trigger is being fired
    Results of updating PK with same value:
    1. Timestamp didnt change
    2. Trigger didnt fire
    Is this enough to make conclusion that updating primary key with same value ALONG with updating some other columns won't
    affect child tables with UPDATE CASCADE ON
    Update:
    Database is CI AS collation
    If i do following
    Update Employee
    set Id = 'abc',
    Name = 'something new'
    where Id = 'ABC'
    1. Timestamp will change
    2. Trigger will fire
    Conclusion: Case sensitive is important here!
    Thank you very much in advance
    Milos

    >>  would like to understand how sql server 2008 deals with cascade updates <<
    Your posting has a number of conceptual errors. 
    1. The terms “parent” and “child” are not RDBMS; they are used in network databases. We have “referenced” and “referencing” tables; they can be the same table.
    2. A table models a SET of things, so there is no “Employee” table unless you truly have a one-man company. We want a collective or plural name for the SET/table. A better name is “Personnel” for this table. 
    3. Her is no such thing as a generic “id” in RDBMS; it has to be “<something in particular>_id” to be valid. Identifiers are usually fixed length 
    4. It is very, very rude not to post DDL on a forum. You also do not know the ISO-11179 Rules for data element names. They do not change names from table to table! Does your name change whenever you use it in a new place?? NO! Same principle with data. 
    5. The ISO standard uses “<property>_<attribute property>” syntax, no the old PascalCase.
    6. Why did you post a useless narrative? How do we compile “I SET up Cascade UPDATE for those two tables,..” to test it?? 
    CREATE TABLE Personnel
    (emp_id CHAR(20) NOT NULL PRIMARY KEY,
     emp_name VARCHAR(25) NOT NULL,
    CREATE TABLE Health_Plan
    (health_plan_acct CHAR(20) NOT NULL PRIMARY KEY,
     emp_id CHAR(20) NOT NULL 
     REFERENCES Personnel(emp_id)
     ON UPDATE CASCADE
     ON DELETE CASCADE,
    Scenario 1:
    UPDATE Personnel
       SET emp_id = 'ABC',
           emp_name = 'something new'
     WHERE emp_id = 'CCC';
    Result of child table: all rows with foreign key emp_id and value of 'CCC' are updated. Expected behavior.
    Scenario 2:
    UPDATE Personnel
       SET emp_id = 'ABC',
           emp_name = 'something new 2'
     WHERE emp_id = 'ABC';
    This time, I am doing something different. I am beside UPDATE of column emp_name with new value, also UPDATE PRIMARY KEY but
    with SAME value.
    >> Question is: what is going to happen to child [sic: referencing]  rows? Are they ALL going to UPDATE due to CASCADE UPDATE. <<
    SQL uses a set-oriented model, so the whole table is updated as a unit of work in theory. 
    So far, what I did in order to find solution is:
    >> I put an timestamp column in child [sic: referencing] table that should UPDATE each time row gets updated <<
    Why? It is not in the SET clause list; it cannot change. As an aside,  The T-SQL TIMESTAMP is not the ANSI/ISO TIMESTAMP; it is DATETIME2(n) in T-SQL. The old TIMESTAMP is being deprecated because it stinks both in concept and implementation. 
    >> I put a trigger for UPDATE event on child [sic: referencing] table that will write something to some log table.<<
    TRIGGERs are fired by what is called a “database event” shown in the ON [DELETE | UPDATE] clause. T-SQL adds INSERT as an event. An update to any value or to no value at all is still an update. Depending on the collation, case may or may not matter in the final
    outcome. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Cascading Updates in database

    Hi,
    I am using Oracle 10 XE, and using Oracle ADF with JDeveloper. I have some basic database tables that users fill in using forms from Oracle ADF. However, there are more complicated database table that rely on these basic tables. My question is when a user makes changes to these basic database tables, how do I cascade the users updates to the more complicated databases tables in Oracle 10 XE?

    depending on the specific of what you are going to need you should read about composite associations
    http://docs.oracle.com/cd/E16162_01/web.1112/e16182/bcentities.htm#sm0150
    Which does handle some cascading issues for you.
    And also about 4.10.9 How to Synchronize with Trigger-Assigned Values
    http://docs.oracle.com/cd/E16162_01/web.1112/e16182/bcentities.htm#BABBHCHI

  • Getting PK Constrain Error while Loading Incremental update in ODI 12C

    Hi
    I am gettig below error while running mapping. I tried Distintct and PK all possible vays but not able to find any solution . Please guide me if any one faced similler issue
    ODI-1228: Task Insert new rows-IKM DB2 400 Incremental Update- fails on the target connection P5LPAR2.
    Caused By: java.sql.SQLIntegrityConstraintViolationException: [FMWGEN][DB2 JDBC Driver][DB2]Error occured with SQLCode -545 with the following parameters: Q_CRPDTA_F55DM050_PRIKEYCHK_00001, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null
    Regards
    naren

    Exactly how are you filtering for incremental records?
    Also we ideally need to know what Knowledge Module you have used.
    An Incremental Update KM generally uses a detection strategy (e.g Not Exists / Minus etc).
    My suggestion would be to leave the temporary objects on and take a look at the contents of your I$ table after the interface has run / failed - Then apply the same SQL logic being used to integrate from I$ to target , e.g Merge or insert and look if you have a bad unique key defined, or indeed nulls in any of your key columns.

  • JPA - cascade update

    Hello,
    Let's say I have these 2 classes:
    public Class Pessoa {
    @Id
    @Column(name = "ID_PESSOA", nullable = false)
    private Long idPessoa;
    private String nmPessoa;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pessoa", fetch=FetchType.EAGER)
    private Collection<Telefone> fones;
    public Class Telefone {
    @Id
    @Column(name = "ID_FONE", nullable = false)
    private int idFone
    private String nrFone;
    private int tpFone;
    @JoinColumn(name = "ID_PESSOA", referencedColumnName = "ID_PESSOA")
    @ManyToOne
    private Pessoa pessoa;
    And then I try tu update the Pessoa object:
    Pessoa p = pessoaDAO.getPessoa(cdPessoa);
    p.setNmPessoa("Maria");
    p.getFones().removeAll(p.getFones());
    p.setFones(newFoneCollection);
    pessoaDAO.atualizar(p); // merge(p)
    After this I can see the change on the nmPessoa, but it does not happen on fones.
    I can have some changes if I add new fones, but the ones I already have stay in DB.
    Could someone tell me how I can do it?
    tks!

    Hi Mike,
    thanks for the reply!
    I did a test using the Derby DB (from netbeans 5.5) which has some tables. I took 2 tables ORDERS and CUSTOMER that has the same relation as PESSOA and TELEFONE.
    In this test netbeans generated the entities automatically and I just created the TestClass like this:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("testaCascadePU");
    Persistencia persis = new Persistencia(emf); // has EntityManager, persist/merge/remove/find
    Customer c = (Customer)persis.find(entity.Customer.class, new Integer(1));
    Customer cTemp = new Customer(c.getCustomerId());
    Orders o = new Orders();
    o.setQuantity(new Short("30"));
    o.setShippingDate(new Date());
    o.setCustomerId(cTemp);
    o.setOrderNum(new Integer(10398011));
    o.setProductId(new Product(new Integer(980001)));
    Collection<Orders> ordersL = new ArrayList();
    ordersL.add(o);
    c.setName("Robert Plant Test");
    for (Orders os: c.getOrdersCollection()) {
    os.setCustomerId(null);
    os.setProductId(null);
    c.getOrdersCollection().removeAll(c.getOrdersCollection());
    c.setOrdersCollection(ordersL);
    persis.update(c);
    And this test still have the same problem that I had before.
    Even when I "unset" the orders, I keep getting the same orders in the DB plus the new order instead of getting just the new order as I wish.
    Am I doing something wrong?
    This scenario is quite common but I really don't know how to deal with it.
    Thanks again!

  • Cascade Update Manually

    Hi,
    If I want to update a Primary Key to a new value and there are existing references to it in a Foreign table, and I do not have On UPDATE CASCADE, how can I accomplish this?
    do I have to delete all the child records, update the parent's primary key, and then insert the child records again w/ the updated primary key?
    Thanks!

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    >> If I want to update a PRIMARY KEY to a new value and there are existing references to it in a Foreign [sic: referencing] table, and I do not have ON UPDATE CASCADE, how can I accomplish this? <<
    Alter your table and add the constraint. If you missed this one, look  for more design errors and commissions. 
    >> do I have to delete all the child [sic: referencing] records [sic: rows], update the parent's [sic: referenced] primary key, and then insert the child [sic] records [sic]again w/ the updated primary key?<<
    You need to learn basic terms and concepts! And t kick the guys that forgot this in the first place. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Cascade update in forms 10g

    I have a master-detail block in my form. My question is When I update one record in master block and commit the corresponding child table records should be updated. I know there exists an integrity constraint between the tables and I am getting an error of "Integrity constraint exists and child record found". Is there any way we can do a work around for this in forms 10g. Your help is appreciated.
    thanks
    marcbhar

    When one record is updated in Master table the corresponding records in child table should also get updated.
    For example,
    Master Table: Tbl_Mast has colums m_id, s_code, name, sub_name
    Records : m_id s_code name sub_name
    1 M008.01 sales valid
    2 K009.02 marketing invalid
    Detail Table: Tbl_Detail has colums detail_id, s_code, name, subname, sale_no
    Records : detail_id s_code name subname sale_no
    48 M008.01 sales valid 1111
    49 M008.01 sales valid 238
    50 M008.01 sales valid 400
    Now my question is, If I update sub_name = "invalid" where s_code="M008.01" in Tbl_Mast then all the records in detail table Tbl_Detail should be updated as follows
    48 M008.01 sales invalid 1111
    49 M008.01 sales invalid 238
    50 M008.01 sales invalid 400
    Now I am getting this following error.
    ORA-02292: integrity constraint (A.S_SDC_FK) violated - child record found

  • Cascade update of primary key in child tables

    Hi,
    We have a typical scenario in which the primary key has to propage to the child table into 3 levels. We are getting the no parent key exception if we create new data into the three tables using 3 level master detail relationship and execute commit operation. The following is the structure of the tables.
    Parent_table (sno number primary key, name varchar2(100));
    Child_table (fk_sno number primary key, name varchar2(100), foreign key (fk_sno) references parent_table(sno));
    GrandChild_table (sno number primary key, fk_sno number, name varchar2(100), foreign key (fk_sno) references Child_table(fk_sno));
    The requirement is to update fk_sno in child_table and grandchild_table with the trigger generated primary key sno in the parent_table.
    The application module is having the following structure
    parenttable
    |
    ----------childtable
    |
    -----------grandchild_table
    If we create new records into parent_table and child_table it is working fine when we commit the data. If we create another record into grandchild_table and commit data we are getting the foreign key violation exception. We are using composition in the association to update the modified values to refresh the data.
    Is there any problem in the data model to use fk_sno as primary key and foreign key in child_table.
    Thanks and Regards,
    S R Prasad

    Hmm, another example is CSKS, this logic was probably designed already in the 1980s...maybe it was seen beneficial to be able to select the currently valid record by using the primary key only (the first record where DATBI is larger than system date, not possible when DATAB is the key instead).
    Maybe there are better explanations. Why do you need to know this, just curious?
    Thomas

  • Security lost in Planning after an update by ODI (v.10.1.3.6.8)

    Hi
    Anyone ever saw this?
    We've made a package to update dimensions in Planning using Planning adapter.
    At the end, sometimes it deletes group access than the users lost their access. (On those case, we need to reload the secfile)
    We found that by activate Planning audit.
    Thanks
    Alain.

    It means you have not imported in the new KM for "IKM SQL to Hyperion Essbase (Data)", you are still using the original one and it will fail because the new version has additional options.
    Right click the existing KM - Import/Replace and browse to the IKM SQL to Essbase Data.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • Issue Retro Payroll with currency

    Dear all! I have problem, i try to find out the reason but not succeed. I am using Payroll Schema running for employee in India, of course currency is INR. However I hired 1 employee with currency as USD. The rate 1 USD = 46 INR. Decimal of INR is 3

  • Moving a folder from external to internal hard disk

    I want to move a music folder on my external hard drive to the internal one. I had previously disabled the option of copying files to iTunes library so this folder is not a part of iTunes Music folder Music/iTunes/iTunes Music but is is added to the

  • Disabling onboard sound on K8T Neo?

    Hello, I'm probably being really stupid here but I just can't seem to find the BIOS setting to disable the onboard sound. Can't find it on any of the BIOS pages, can't find it in the manual and there doesn't seem to be a dipswitch on the board itself

  • Problem with free space on itnernal hdd on mac book pro!

    On the about this mac menu i storage i get 512 gb of backups and if you add all the numbers given for the internal hd the total is 837.88 gb on a 750 gb hd! When i go to finder my macbook pro and get info on the macintosh hd ->get info i get 582 bg f

  • Problem With Site Access

    Hi guys, I've been trying to access the Market Place as well as my account at: www.renderosity.com, but when I click to the Market Place on the link I get the message below (included also is my correspondence with the site's admin). I can access the