It's possible ON UPDATE CASCADE in table relationships?

Hi, how are you?
Sorry my weak English, I'm brazilian.
I like create an "ON UPDATE CASCADE" in my table relationship but find only "ON DELETE CASCADE" in Oracle 9i Database Online Documentation.
I would like your help.
Thank you.
Eduardo A. Reche Lopes
Team T.I.
www.coodetec.com.br

Tom Kyte wrote a package for this:
UPDATE CASCADE PACKAGE
Generates needed package and triggers to support update cascade in Oracle without removing or infringing on DECLARITIVE RI.
This package supports:
- Tables with multi-part primary keys (primary key(a,c,b))
- Update cascade to many child tables from one parent
- Self-referencing integrity such as that found in the SCOTT.EMP table (mgr->empno)
- Is completely application transparent. The application does not know it is happening
- Versions 7.0 and above of the database.
- Tuned and optimized to fully avoid full table scans on all tables (complete with utility to show you un-indexed foreign keys in a schema, Cascading an update to un-indexed foreign keys can be bad).

Similar Messages

  • Update or delete table from XML

    Is it possible to update or delete table's row from XML file?
    Thanks
    Prasanta De

    Hi Steve,
    Thanks for your reply but I could not find any example from the documentation for update-request or delete-request. I need your help in this regards.
    1. I have emp table with many rows and the simple structure like this
    DEPTNO NUMBER(2)
    EMPNO NUMBER(2)
    EMPNAME VARCHAR2(20)
    EMPSAL NUMBER(8,2)
    Key is defined on deptno and empno
    2. I have a xml file like this
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>1</DEPTNO>
    <EMPNO>11</EMPNO>
    <EMPSAL>1111.11</EMPSAL>
    </ROW>
    <ROW num="2">
    <DEPTNO>1</DEPTNO>
    <EMPNO>12</EMPNO>
    <EMPSAL>2222.22</EMPSAL>
    </ROW>
    <ROW num="3">
    <DEPTNO>1</DEPTNO>
    <EMPNO>13</EMPNO>
    <EMPSAL>3333.33</EMPSAL>
    </ROW>
    </ROWSET>
    3. I want that xsql servlet will read this xml file and update EMPSAL column depending upon the value of DEPTNO and EMPNO from xml file.
    Please let me know how I should use update-request in xsql page.
    Thanks
    Prasanta De
    null

  • How to update the VBFA table without entries in VBRK and VBRP tables

    Hello,
    I have a requirement , where the sales order , delivery happens in one SAP system say X system and billing document wil happens in other sap system say Y.
    Now in this particular case , if the user want to know the billing document number in X system. what would be the solution.
    Is there any possibility to update the VBFA table with invoice number of Y system (without updating the VBRK and VBRP tables).
    User want to see the billing doc number from sales order in the form of document flow in X system
    Thanks in advance
    Pradeep

    Hii
    Without updating VBRK/VBRP table and updating VBFA is not possible, So you have to play with work arround to create one Z TABLE, so whenever system Y will create billing document with the reference of System X data you have to update Ztable with Invoice number created in System Y, The primary key will be in Z TABLE is Delivery document number to track one to one with billing doc.
    Thanks and Regards
    Shambhu Sarkar

  • Is it possible to update attributes in all tables in a multi entity view

    Hi I have a view based on 4 entities, all of which are a 3 of which are 1 to many relationship with the 4th. The 3 additional entities have 2 or 3 attributes, Id, name, and one entity has a foreign key relating to a different table which I do not care about. The IDs are all updatable in the entity, and none of them are generated from a sequence but are inserted manually, except for the 4th (Master?) which is generated from a sequence.
    I create the view and all the entities are updatable, but in the view when I go to attributes from the other tables, it says updatable never and is grayed out so I cannot change it, even though in the entities tab, it is updatable always.
    So I was wondering if this was possible to do???

    I do not understand really, if it is 2 different tables, it is 2 different primary keys. Why would this even happen? What does it matter if EmployeeID and DepartmentID is both 1??? It just seems that there has to be a simpler way to do this but ok.
    So I go to the AppModule, Java tab and go generate Java class. The original code was
    public ViewObjectImpl getObjektiCRUDView1()
    return (ViewObjectImpl)findViewObject("ObjektiCRUDView1");
    I then copy your code to the best of my limited knowledge and get this
    public ViewObjectImpl getObjektiCRUDView1()
    this.getObjektiCRUDView1().executeEmptyRowSet();
    {Row yourRow = this.getObjektiCRUDView1().createRow();
    this.getObjektiCRUDView1().insertRow(yourRow );
            return (ViewObjectImpl)findViewObject("ObjektiCRUDView1");
    On the first row the getObjektiCRUDView1() is underlined and it says missing method body or declare as abstract.
    I know I did something wrong here but I have no idea what as I am not very good with Java
    Also it is not a jsf page, I create a single jspx page and divided it using the panel splitter so on one side we have an adf table for updating the Objekti database table, and on the other side I have an adf form for updating the Positions table (and later on other tables, I hope to have many forms there)
    Edited by: Dino2dy on Jun 10, 2010 12:02 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Is it possible to update internal table from database table

    Hello All:
              I know how to update database table from internal table in one shot (batch) but is the reverse possible? Can I update some fields in an internal table from a database table in one shot (without looping) because my internal table is huge? Could you please provide me any ideas how to acheive something like this? Thanks in advance and answers will be rewarded.
    thanks.
    Mithun

    Hello my friend,
    You can do it MAYBE , i think you can reverse the update doing a ROLLBACK, but only after you update....not after the program finishes..
    To update some fields at once use:
    UPDATE DBTABLE FROM TABLE IT_TABLE
    Hope this helps!!
    Gabriel

  • Is progamatic update to Configuration table (T Table) possible ?

    Hi All,
    Is it possible to update the configuration (T Table) table (INSERT / DELETE) through program? Is there any restriction ? When I tried to use INSERT statement in my program to update TCJ04,  it didn't work.Is it because the client is non-modifiable for config table ? We even can not try BDC as that client is non modifiable.
    My requirement is to update TCJ04 table from HR table PA0002. Now I am thinking about feasibility. Any idea ?
    Thanks,
    Achirangshu

    When it is configurable table why dont you update the table in which client you can configure then transport it up.
    Configuration tables can be updated using proper key but not a good idea.
    Well, you need to check your program - what is sy subrc value after insert?
    What is the table maintainance ?
    are you using commit work after sy subrc = 0?
    Post your code if you are doing all above

  • Automatic payment program (F110) document are not update in PAYR table

    Hi all,
    I have make payment in F110 (automatic payment) to customer 
    But it is not update in PAYR table
    Please guide me what I have to do for documents update in PAYR table
    Thanks and Regards,
    Prudhvi

    Hi,
    It is possible to enter multiple documents.
    You can enter a list of single documents or in intervals.
    Enter the document number in ascending order.
    Ex:
    Individual documents.
    10001,10003,10011
    If the documents are in a sequence you can enter the Interval like this
    (10001,10011)
    Hope it helps you
    Regards
    Andrew
    Edited by: Andrew J on May 28, 2009 4:26 PM

  • Excise Base amount not updated in J_1iexcdtl table -reg

    Dear Gurus,
    We have used SAP Ecc 5.0 Patch level 21. In patch level 20, SAP admit without delivery , can do commercial billing and excise billing in foreground. After batch update SAP not support excise invoice creation in foreground. It support only background. We have 2 senario. 1 is capex sales . ie. without material stock we have raise the comm.billing and excise billing. 2 is supplimentary billing. both the senario now getting effected because of no delivery. Asper SAP advise we have setting for background process excise invoice creation. Excise invoice created. but excise base amount not updated in j_1iexcdtl table. Using J_1I7_USEREXIT_CALC_EXC_BASE user exit we are trying to update the same. For single material it works fine. But more than one material for the first material's base amount is updated in all materials. for your reference i have mentioned the codding . SAP advise it is possible to update excise base amount. But not possible to do. pl.adivse if any correct or guide to solve it.
    FUNCTION J_1I7_USEREXIT_CALC_EXC_BASE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(EXCITM_BASE) TYPE  KOMV-KAWRT
    *"     VALUE(POSNR) TYPE  VBRP-POSNR
    *"  EXPORTING
    *"     VALUE(EXCITM_BASE) TYPE  KOMV-KAWRT
    *"  TABLES
    *"      KONV STRUCTURE  KONV
    *{   INSERT         RDSK925285                                        1
    TABLES : KONV.
    data :   W_INDEX LIKE SY-TABIX.
    DATA :ITAB LIKE TABLE OF KONV WITH HEADER LINE.
    DATA :ITAB1 LIKE TABLE OF KOmV WITH HEADER LINE.
    ITAB1[] = KONV[].
    DATA : BEGIN OF I_TAB OCCURS 0,
           KAWRT LIKE KONV-KAWRT,
           POSNR LIKE VBRP-POSNR,
           END OF I_TAB.
    LOOP AT ITAB1.
    READ TABLE ITAB1 WITH KEY KSCHL = 'JMOD' KPOSN = ITAB1-KPOSN.
    IF SY-SUBRC EQ 0.
        EXCITM_BASE = ITAB1-KAWRT.
        POSNR = ITAB1-KPOSN.
    ENDIF.
    ENDLOOP.
    *}   INSERT
    ENDFUNCTION.
    Thanks & Regards
    R.Udayakumar

    solved with the same user exit

  • Updates to the table from the database level.

    Hi Dear All,
    If we do some updates to the table at the Database Level, like i deleted some records from the table at the Oracle level. But I'm still able to see the same deleted records from the Data Dictionary(SE11) at the application level.
    Can you pl explain the mechanism, that how it is possible and why.
    best regards
    Mahesh

    transparent tables store data directly....if you delete some data from transparent tables, the same is reflected in the database (oracle) but the reverse is not true...if you modify the database table contents directly...the dictionary table remains intact...
    transparent tables have a one-to-one relationship with the database tables....
    hope that clarifies a bit....
    (somebody correct me if i am horribly wrong)

  • Equipment not updated in all tables properly

    Hi Friends
    Equipment was updated in EQUI table with limited data only and not updated in other tables EQKT, EQUZ. When I go through the IE03, there I am unable to find the equipment. Material and serial number provides the equipment, I know it, but if we check it in IQ02 for the serial number with the material, I was unable to see the equipment details those are sales and distribution tab and some tabs not updated and equipment not activated. When I tried to activate the equipment in IQ02, system allows saving the document. When I am coming back, system is giving the update termination error. I think at the time of creating user might have done some mistake, but I am unable to find it
    Could you please let me know the reason and possible solution?
    Thanks in advance
    Ravi

    hi
    After creating the equipment in IE01 ,you are not able to change in IE02 or display the same in IE03, then kindly check with your basis team for your update termination error
    regards
    thyagarajan

  • Heeeeelp - on update cascade

    hi all
    I posted the same question inn this forum but did not get any answer i'll try again in this post
    my problem is that i created my tables in the database without on delete cascade on the foreign constraint and now 'm trying to modify that
    I dropped the old foreign constraint and created new one with "on delete cascade" this worked fine for one table but when i came to the other tables it gave me this error:
    ORA-02443:cannot drop constraint - constraint unavailable
    but I'm sure the constraint with the name i used is available !!!
    what are your suggestions???
    another problem:
    how to implement on update cascade in Oracle?
    I found a solution in http://asktom.oracle.com/tkyte/update_cascade/index.html#download
    but I don't know how to use , if someone knows please help
    Thanks in advance

    1 .
    select constraint_type,constraint_name from user_constraints where table_name='<TABLE_NAME>' and
    see if the constraint name that you are trying to delete exists.

  • Hi I bought a macbook in 2007/2008 and am wondering if it is possible to update the operating system? Here are my system details: Hardware Overview:    Model Name:     MacBook   Model Identifier:     MacBook4,1   Processor Name:     Intel Core 2 Duo   Pro

    Hi, I bought a Macbook in 2007/2008 and am wondering if it is possible to update my system so I can get the new version of iTunes?
    Here are my current system details: Mac OsX Version 10.5.8
    Hardware Overview:
      Model Name:    MacBook
      Model Identifier:    MacBook4,1
      Processor Name:    Intel Core 2 Duo
      Processor Speed:    2.4 GHz
      Number Of Processors:    1
      Total Number Of Cores:    2
      L2 Cache:    3 MB
      Memory:    2 GB
      Bus Speed:    800 MHz
      Boot ROM Version:    MB41.00C1.B00
      SMC Version (system):    1.31f1

    The model 4,1 can run a maximum of 10.7 Lion.  The 10.6 Snow Leopard DVD is in the Apple online store. You can get it for $19.99. After you’ve installed that then download the 10.6.8 combo updater to finish it off. http://support.apple.com/kb/DL1399 You will need to be running 10.6.8 to access the App Store to order Lion. http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard
    System Requirements for 10.6:
    Mac computer with an Intel processor
    1GB of memory
    5GB of available disk space
    DVD drive for installation
      Some features require a compatible internet service provider: fees may apply.
    You can upgrade from 10.5 to 10.6 with no problems as long as you have at least 1gb of RAM. Any program that runs under 10.5 should run under10.6. See this list for third party programs compatibility with 10.6: http://snowleopard.wikidot.com/  You might have to upgrade some drivers for printers, etc.... And you will have to install Rosetta if you have any Power PC applications 
    http://www.macobserver.com/tmo/article/snow_leopard_installing_rosetta/  
    Once you are at 10.6.8 Lion is still available from Apple. You will have to call Apple Customer Care 1-800-692-7753 or 1-800-676-2775. to purchase it. Then within 3 days you will get an email with a code which you can use to download Lion from the App Store. Or go to http://store.apple.com/us/product/D6106Z/A/os-x-lion and purchase it there. The price is $19.99.
    Lion will require at least 2gb of RAM but really needs 4gb to run smoothly.
    As for third party programs see this list for compatibility with 10.7 http://roaringapps.com/apps:table
    Also Lion doesn't run any Power PC programs. To see if you have any Power PC programs go to the Apple in the upper left corner and select About This Mac, then click on More Info. When System Profiler comes up select Applications under Software. Then look under Kind to see if any of your applications are listed as Power PC. Universal and Intel will run under Lion.
    Before Mac switched to Intel processors in 2006 they used Power PC processors from 1994 to 2005. Power PC 601 through 604, G3, G4 and G5. Applications written for the Power PC processors need the application called Rosetta to run on Intel processors. This was part of the Operating System in 10.4 and 10.5 but was an optional install in 10.6. With 10.7 Lion Apple dropped all support for Power PC applications.

  • ON UPDATE CASCADE and Autoincrement primary key with Oracle SQL Developer

    hello everybody,
    I want to know if Oracle SQL Developer manage autoincrement on primary key and "ON UPDATE CASCADE" when i migrate (with data) SQL Server database in Oracle database.
    Can you help me ?
    Thanks for your suggestions.

    Obtain the value of the auto increment key with the getGeneratedKeys() method.
    Statement stmt = null;
    ResultSet rs = null;
    stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
                                    java.sql.ResultSet.CONCUR_UPDATABLE);
    stmt.executeUpdate("DROP TABLE IF EXISTS autoIncTable");
        stmt.executeUpdate(
                "CREATE TABLE autoIncTable ("
                + "priKey INT NOT NULL AUTO_INCREMENT, "
                + "dataField VARCHAR(64), PRIMARY KEY (priKey))");
    stmt.executeUpdate(
                "INSERT INTO autoIncTable  (dataField) "
                + "values ('data field value')",
                Statement.RETURN_GENERATED_KEYS);
    int autoIncKeyFromApi = -1;
        rs = stmt.getGeneratedKeys();
        if (rs.next()) {
            autoIncKeyFromApi = rs.getInt(1);
        } else {
        rs.close();

  • Updating a Base Table through a View having UNPIVOT function.

    Hi,
    I have a requirement of updating a Base Table through a View.
    This View has the query using a UNPIVOT function for displaying the columns of the Base tables in rows.
    I need to update/insert into/delete the Base Table by accessing the View (The user doesn't have an access to the Base Table, hence the DML's on the View).
    Following is the table I've created:-
    CREATE TABLE PERSON_DETAILS
      PID            VARCHAR2(10 BYTE),
      FIRSTNAME      VARCHAR2(1000 BYTE),
      LASTNAME       VARCHAR2(1000 BYTE),
      PHONENUMBER    VARCHAR2(1000 BYTE),
      ADDRESS1       VARCHAR2(1000 BYTE),
      ADDRESS2       VARCHAR2(1000 BYTE),
      COUNTRY_CODE   VARCHAR2(1000 BYTE),
      LANGUAGE_CODE  VARCHAR2(1000 BYTE),
      EMAIL          VARCHAR2(1000 BYTE)
    )The sample values are inserted in this table through the below script:-
    insert into person_details values ('1','XYZ','ABC','1234567890','India','Asia','IN','EN','[email protected]');
    insert into person_details values ('2','XYZ2','ABC2','1234567890','India','Asia','IN','EN','[email protected]');The code for the view is as below:-
    CREATE OR REPLACE FORCE VIEW PERSON_DETAILS_VIEW
       PID,
       CD_NAME,
       CD_VALUE
    AS
       SELECT "PID", "CD_NAME", "CD_VALUE"
         FROM person_details UNPIVOT INCLUDE NULLS (cd_value
                             FOR cd_name
                             IN  (firstname AS 'First Name',
                                 lastname AS 'Last Name',
                                 phonenumber AS 'Phonenumber',
                                 address1 AS 'address1',
                                 address2 AS 'address2',
                                 country_code AS 'Country Code',
                                 language_code AS 'Language Code',
                                 email AS 'Email') );Below are the values from the view:-
    PID CD_NAME         CD_VALUE
    1    First Name       XYZ
    1    Last Name       ABC
    1    Phonenumber  1234567890
    1    address1         India
    1    address2         Asia
    1    Country Code   IN
    1    Language Code EN
    1    Email               [email protected]
    2    First Name       XYZ2
    2    Last Name       ABC2
    2    Phonenumber  1234567890
    2    address1         India
    2    address2         Asia 
    2    Country Code   IN
    2    Language Code EN
    2    Email               [email protected] user would fire some statement like below:-
    update person_details_view
    set cd_value = 'US' where CD_NAME = 'IN'The above statement should update the base table PERSON_DETAILS.
    I understand I can write an INSTEAD OF trigger but I do not know what logic to write in the trigger so that the requirement gets fulfilled.
    My Oracle Version
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0    Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionAny help would be highly appreciated.
    Thank You,
    Ankit Khare.
    Edited by: Ankit_Khare84 on Jun 28, 2012 2:47 PM

    it is definitively possible with an instead of trigger.
    for Example:
    create or replace
    TRIGGER ioft_person
    INSTEAD OF UPDATE
    ON person_details_view
    FOR EACH ROW
    declare
    firstname1  person_details.firstname%type;
    BEGIN
                  SELECT firstname_new into firstname1
                  FROM   (SELECT pid, cd_name, cd_value
                          FROM  
                                  select * from person_details_view where (pid, cd_name) not in (select :new.pid, :new.cd_name from dual)
                                  union all
                                  select :new.pid, :new.cd_name, :new.cd_value from dual
                  PIVOT  ( max(cd_value) AS new FOR (cd_name) IN
                                                          ('First Name' AS firstname,
                                                            'Last Name' as lastname,
                                                            'Phonenumber' as phonenumber,
                                                            'address1' as address1,
                                                            'address2' AS address2,
                                                            'Country Code' as country_code,
                                                            'Language Code' as language_code,
                                                            'Email' as email
                  )  where pid = :old.pid;
      UPDATE person_details
      SET firstname = firstname1
      WHERE pid = :old.pid;
    END ioft_role_perm;and than run
    update person_details_view
    set cd_value = 'X|X' where cd_name = 'First Name' and pid=1The logic is: you must convert back the view through pivoting

  • APEX DB: Not accepting the constraint ON UPDATE CASCADE

    Hi
    My schema tables is not accepting the ON UPDATE CASCADE constraint as it was accepting the ON DELETE CASCADE constraint. My use case is to update the records in the child tables, when a PK of parent table is modified/updated. Please help.
    Thanks
    Bhavesh

    Bavesh,
    Boy this question could spark a huge debate about relational theory and the merits of allowing the update of a primary key... But instead of stirring the pot, I'll answer your question. :-)
    Unfortunately Oracle does not support the ON UPDATE CASCADE constraint that PostgreSQL and other databases do.
    You might look at [this discussion|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5773459616034] on ASK TOM where he talks about the merits and references a couple ways you can achieve similar things in Oracle.
    Hope That Helps,
    - Doug -
    http://sumnertech.com/

Maybe you are looking for

  • Windows 8.1 Lenovo ThinkPad Cannot See Printer

    I have a couple of issues.  The HP full software 64bit for windows 8.1 and my printer is OfficeJet Pro 8500 a909g.  Install software wizard wont find my printer via wireless.  Also the AiO remote app in windows 8.1 won't connect to the printer.  Howe

  • Three displays with GTX 670 -- duplicating desktop problem

    Just got a new computer with an Asus GTX 670 card.   I am running 3 displays:  1. (Main) Dell U2412M via DVI port,   2.  Old Samsung LCD monitor via DVI port with VGA adapter,  3. Samsung 59" plasma TV via HDMI port.  I am trying to duplicate the des

  • Is it possible to eliminate text bubbles

    Is it possible to eliminate text bubbles from imessage? I want straight text, no bubbles

  • Parent not finished until children complete - stops new job from starting

    Is there anyway that we can 'de-link' 'disassocaite' - some method that we can start a new job again - even though children of a previous job are still active. This is causing quite a problem in our system whereby we need to start another background

  • So I may have messed up with disk utility.

    So I was messing around with disk utility and was partitioning out some of my hard drive. I then accidently quit disk utility part of the way through.  So now, part of it's partitioned out, but it wont show up.  And since I can't find it, I can't get