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

Similar Messages

  • 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

  • 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

  • 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

  • Update the database.

    Hi,
    I have a (server 1) 10.2.0.3 on RHEL. I have upgraded it to (server 2) 11.2.0.1.0 on Windows 2003 Server. Tis was done three months back. The user have tested server 2 and said it is OK. Now they are ready to make it "the production" one. Now I have to update the database. (since during the period of testing, the server 1 was production and have more updated data.) How would I do that? Do I have to delete the old database on server 2, again create a new database, and then do the exp and imp? or is there another way?
    Thanks,

    Make a full export but only import the application schema's.
    Before doing that you have to drop the application schema user (cascade) and create the user again.
    The related tablespaces will still be there but they are empty because of dropping the schema user.
    After that you can import only the application schema's from the full export.
    Finally your production database is still the same but the application schema is updated with the latest data from the export dump.

  • 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

  • Error while updating a database

    hi,
    i am getting an error "Object reference not set to an instance of object" while updating a database. here is my code..
    QryStr = "update OSRI set U_sqf = Val('" & sqft & "'),U_sqm = Val('" & sqmt & "') where ItemCode = '" & Code & "'"
                RecSet.DoQuery(QryStr)
                Res = True
    Edited by: puneeth shankar on Jul 2, 2008 7:27 PM

    Hi
    Maybe you are missing these sentences ..
    Dim RecSetAs SAPbobsCOM.Recordset
    RecSet= SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    and then
    QryStr = "update OSRI set U_sqf = Val('" & sqft & "'),U_sqm = Val('" & sqmt & "') where ItemCode = '" & Code & "'"
    RecSet.DoQuery(QryStr)
    Res = True
    But I think you are trying to update directly using an Update statement to a SAP table.  You must check the documentation.  I think this is not allow.  You must then use an alternate way !

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • Problem while updating a database table

    Hi experts,
                         I've used the FM 'HR_INFOTYPE_OPERATION' to update the database table. In that i used the MOD operation to update the Infotype PA0315.  But it return an error message like "Infotype does not exist". What could be the reason for this error?.
    regards,
    Shanthi.

    Hi,
          Here is my code for updation.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = P0315-pernr
    IMPORTING
    RETURN = wf_returne.
    Update Mode
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '0315'
    NUMBER = P0315-PERNR
    SUBTYPE = P0315-SUBTY
    OBJECTID = P0315-OBJPS
    LOCKINDICATOR = P0315-SPRPS
    VALIDITYEND = P0315-ENDDA
    VALIDITYBEGIN = P0315-BEGDA
    RECORDNUMBER = P0315-SEQNR
    RECORD = P0315
    OPERATION = 'MOD'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    IMPORTING
    RETURN = wf_return.
    Dequeue
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = P0315-PERNR.

  • Problem viewing/updating MySQL-database with utf-8 charset

    System specs:
    Tomcat 5.5.4
    JDK1.5.0
    MySQL 4.1
    Connector/J 3.0.16
    JSTL 1.1
    I am trying to build a guestbook web-app, and want to be able to store swedish characters (available in latin1) and decided to give utf-8 a go since it would support other languages as well. I use a <Resource> in my context-xml to get the connection.
    This simply will not work; when I use the <%@ page contentType="text/html; charset=utf-8"%> declaration, the swedish characters in the raw html-code gets replaced by questionmarks. Select-queries output look ok though, as long as they don't contain the character '�'
    When removing the page-declaration, the queries show only questionmarks where swedish characters should be.
    The same goes for updating my database. Swedish characters get garbled.
    I have tried the following without success:
    *adding &useUnicode=true&characterEncoding=UTF-8 to the Resource-url -- causes my web-app to fail loading.
    *adding a <filter> to the web-apps web.xml as suggested at  http://www.javaworld.com/javaworld/jw-09-2004/jw-0906-unicode_p.html -- caused another web-app error, resulting in it not being loaded.
    *setting the form attribute accept-charset -- resulted in no improvement.
    Right now I'm half desperate and half fed-up. Is this a common problem with MySQL? Should I use another database? Or perhaps it is the Connector/J Driver that's messing things up.
    I'll appreciate any help I get greatly.

    Hello. Maybe not so interesting after a year to try to ask did you ever get a final solution to that problem in command line perspective. OR does somebody else knows solution to this problem.
    Anyway I have similar problem, I use mysql5 with latin1 charset and I can insert to my database letters ��� normally via mysql command line and they show perfectly. But the problem is my web application.
    I can insert all characters to database and retrieve them normally via web app but if i need to use mysql command line for queries it fails because those special letters appear something like ��. I still need to make queries on mysql command line as admin. I have also tried to change different drivers like
    Class.forName("org.gjt.mm.mysql.Driver"); or
    com.mysql.jdbc.Driver etc connector is 3.0.17
    I have also tried to change to utf-8 and then changed mysql def.enc to same... i have used request.setWHATEVER CHARSET.....i'm out of ideas... help?

  • Lion Mail will not open, and won't update the database. Help??

    When I try to open mail, for the first time says it needs to update my database, It seems to start then crashes. Is there a fix?

    same here, updated all devices, moved to icloud, received mail for a bit now NOTHING. no mail, no backup, won't accept my password......service must be down???

  • Data not updating in database

    Friends i have table and i have created a sequence on basis of that table.
    For 1st page i have created an html region and made few items there and a save button.
    I am filling data to the fields in page 1 and clicking the save button. In save button i have passed the address of the items of 1st page to items of 2nd page which contains the same field of page 1 and few more additional field.
    the 2nd page which i have made is on basis of form on a table or view and taken exsisting sequence there. When i clicking the submit button in page 2 it is not updating my database and throwing error called unable to fetch row. Any suggestions on this?

    Lev addition to this i wanted when my create button in 2nd page get clicks my database gets updated and also a query runs which checks the same data of combination variant_type,model_code,year_manuafacture. It means if i have 2 records in database with same variant_type,model_code,year_manufacture then in the field how_many in page 2 count of 3 gets updated and the other field solution avaiable get updated with Y.
    For this in my local system in page 2 i created a plsql process and wrote this code and applied it with create button but its not working. Any idea where i am failing?
    Declare
    l_how_many Number;
    l_sol_av Varchar2(1):= NULL;
    Begin
    select count(*)
    into l_how_many
    from quality
    where 1=1
    and variant_type= :P2_VARIANT_TYPE --'Road Bike'
    and model_code = :P2_MODEL_CODE --'6'
    and year_manufacture= :P2_YEAR_MANUFACTURE  ; --'2000'
    If l_how_many=null then
        l_sol_av := 'N' ;
    else
        l_sol_av := 'Y';
    end If ;
    :P2_SOLUTION_AVAILABLE := l_sol_av;
    :P2_HOW_MANY_RAISED       := l_how_many;
    Exception
        when no_data_found then
        null;
    end;

  • How to capture the Escalation status in Human Task & Update in database

    Hi,
    I have created a Workflow where I have a humantask. Here if the Approver Escalates the task, I want to capture this Workflow status and need to Update it in the our(Oracle) Database as Escalated. I am Updating the database as Approved when the Approver Approves and Rejected when he rejects. as we can have capture these status. Similarly I want to do for the Escalated status also.
    Please Help I have been stuck to this.
    Thanks.

    No Experts to answer this???????????????????

  • New ABAP Program to check Direct UPDATE in Database Table

    Hi all,
    As per customer requirement , I have to develop ONE  Program which find out that  in which ABAP Program , Programmer has used Open Sql command like  UPDATE , DELETE , INSERT , MODIFY to direct update in Database Table.
    Have a look on all Z-ABAPs, find out if there are statements with "update", "delete", "insert" or "modify" in the coding, then find out if updates to sap-Tables are done
    How can I achived that ?
    Please , If anybody is having idea , than please let me know..
    Thanks You ,

    Hi
    Kindly refer to the below link. This has step by step how you can achieve the checks.
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/12659a90-0201-0010-c18b-9d014f9bed0d]
    But if you want to check if any program they have used 'UPDATE' then you can do like below.
    Go to SE38
    Utilities---> Find in Source Code-
    Find --- UPDATE
    In program - Z* or ZX* if you want to search only in Exits
    Regards,
    Vijay V .

Maybe you are looking for

  • Reading private key: works in jdk 1.5, but throws exception in 1.4

    Hello, I am trying to read an RSA private key from a file. I am using the following code snippet: KeySpec spec = new RSAPrivateKeySpec(modulus, pExp); KeyFactory factory = KeyFactory.getInstance("RSA"); PrivateKey key = factory.generatePrivate(spec);

  • Can I connect a thumb drive to my Mac on a Guest Account?

    My dad needs to use my Mac for an office presentation. He will use the guest account and present from a thumbdrive. Problem is, the Mac can't seem to detect it. Is the guest acount programmed that way? He really needs this.

  • I disabled my ipod and it said to connect to itunes so i did now nothing is happening. What do I do?

    I disabled my ipod today. I changed the password and forgot it. Pretty stupid move my way... So i ended up disabling it for hours! After a while it said Ipod disabled, connect to Itunes so I did. Nothing happened and I need help. Any suggestions?

  • How to clear cache for XML data source?

    Hi All, I'm facing a problem loading XML data into Oracle using Oracle Data Integrator. The problem is ODI will cache the data of the XML file at the first time loading the data. And afterwards, when the XML file changed, ODI will load data from the

  • Question about Java's use.

    Hello. Nowadays in my shcool we are learning Java and I am pretty good in it (to my age , I think.. ) Anyways , I asked my firend what the biggest use of Java, He said that usually , Java is used for communication between servers. my Teacher said tha