Tables ordered by referential constraint (integrity) order

Hi,
I have some 30 tables with SOME (not all) tables having referential integrity.
For example, column B in Table No.2 may refer column A of Table No.1 and so on.
Now I want to read some records from every table and re-insert those records into the same table (after changing some column values).
For this, I am planning to write a procedure which will get these 30 table names as input and do the above for each and every table (read and insert into the same table). The thing I want these 30 tables to be ordered according to the referential integrity. That is the parent tables to be present FIRST followed by child table. So that, when I follow this order when INSERTING records I won't get any referential integrity constraint errors.
In the example above, Table No.1 should come FIRST followed by Table 2 and so on.
Could anyone please throw some light on how to order the given tables in the order their referential integrity.
Thanks.

Data dictionary view DBA/ALL/USER_CONSTRAINTS will show you constraints on your tables. Start with your tables without any FK constraints - these will be parent table(s). Then look for your tables dependent on your parent tables. These will be first child table(s). Repeat the process till you cover all your tables.
SY.
Edited by: Solomon Yakobson on Feb 20, 2012 6:21 AM

Similar Messages

  • Incorrect order for referential constraints in Export

    When multiple tables are selected to export, the created file places the ALTER TABLE statements for the Referential Constraints immediately after the creation of the source table. Unfortunately, most of the time this will mean that the referenced table has not yet been created and the statement will fail.
    All referential constraints should be created as a separate block of statements at the end of the file rather than table by table where errors will occur if the script is simply run.

    I managed to resolve the issue by un-commenting below lines( they were commented in std though) -
    XDECI FILL IT & XDECI FILL RT

  • Adding a Unique and Referential Constraint to  XMLType of Purchase Table

    SQL> desc XDBPO_TYPE
    XDBPO_TYPE is NOT FINAL
    Name Null? Type
    SYS_XDBPD$ XDB.XDB$RAW_LIST_T
    messageType VARCHAR2(4000)
    MessageHeader XDBPO_MESSAGEHEADER_TYPE
    Order XDBPO_ORDER_CLLT
    SQL> desc XDBPO_MESSAGEHEADER_TYPE
    XDBPO_MESSAGEHEADER_TYPE is NOT FINAL
    Name Null? Type
    SYS_XDBPD$ XDB.XDB$RAW_LIST_T
    version VARCHAR2(50)
    payloadId VARCHAR2(4000)
    transmissionAgent VARCHAR2(4000)
    timeStamp VARCHAR2(20)
    senderName VARCHAR2(150)
    senderComponent VARCHAR2(150)
    documentReferenceId VARCHAR2(50)
    documentReferenceIdType VARCHAR2(50)
    dataCleansingDocumentId VARCHAR2(50)
    singleTransaction VARCHAR2(4000)
    Configuration XDBPO_CONFIGURATION_TYPE
    HeaderIndexedAttribute XDBPO_HIATTRIBUTE_CLLT
    I following the example in the demo in
    Adding a Unique and Referential Constraint to Table Purchaseorder
    which the constraint is added to the reference field.
    but for my case, i need to add my constraint
    to MessageHeader/@payloadId
    how do i go about in adding the constraint?
    tried to use this syntax logic but not successful:
    alter table purchaseorder
    add constraint REFERENCE_IS_UNIQUE
    unique (xmldata."Reference")
    Anyone have any idea? Mark?
    Thanks.

    nevermind i solved the problem already
    i will just post the solution incase someone else wants to add constraint to the sub xmltype object
    alter table purchaseorder
    add constraint REFERENCE_IS_UNIQUE
    unique (xmldata."MessageHeader"."payloadId");

  • Referential constraints on XMLType tables

    Hi all,
    I'm trying to create an XMLType table with a foreign key that references another XMLType table. Shouldn't be a big deal, i thought.
    CREATE TABLE datasets (
    ID NUMBER,
    XML XMLTYPE )
    XMLTYPE COLUMN XML XMLSCHEMA "dataset_schema.xsd" ELEMENT "root";
    CREATE TABLE categories OF XMLTYPE XMLSCHEMA "categories.xsd" ELEMENT "categories";
    ALTER TABLE datasets
    2 ADD CONSTRAINT dataset_isvalid
    3 FOREIGN KEY(XML.XMLDATA."dataset"."metaInformation"."referenceFunction"."category")
    4 REFERENCES categories(XMLDATA."category"."name");
    FOREIGN KEY(XML.XMLDATA."dataset"."metaInformation"."referenceFunction"."category")
    ERROR at line 3:
    ORA-22809: nonexistent attribute
    I've then been reading through the postings regarding foreign key and unique constraints and i've managed to understand the concept of nested tables. To my dismay, trying to establish referential constraints my nested tables would throw an ORA-30730 stating this cannot be done.
    I've simplified my schemas a little so it won't get to complicated: one table will store datasets and the other will hold category names.
    The schema for the categories is
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- schema for categories -->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="categories">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="category" type="categoryType" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:complexType name="categoryType">
              <xs:sequence>
                   <xs:element name="subCategory" type="subCategoryType" maxOccurs="unbounded"/>
              </xs:sequence>
              <xs:attribute name="name" type="xs:string" use="required"/>
              <xs:attribute name="localName" type="xs:string" use="required"/>
              <xs:attribute name="type" type="xs:byte" use="required"/>
         </xs:complexType>
         <xs:complexType name="subCategoryType">
              <xs:attribute name="name" type="xs:string" use="required"/>
              <xs:attribute name="localName" type="xs:string" use="required"/>
         </xs:complexType>
    </xs:schema>
    and the schema for the dataset table is
    <?xml version="1.0" encoding="UTF-8"?>
    <!- dataset schema-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:complexType name="datasetType">
              <xs:sequence>
                   <xs:element name="metaInformation" type="metaInformationType"/>
                   <xs:element ref="otherInformation"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="metaInformationType">
              <xs:sequence>
                   <xs:element name="referenceFunction" type="referenceFunctionType"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="otherInformation" type="xs:string"/>
         <xs:complexType name="referenceFunctionType">
              <xs:attribute name="name" type="xs:string" use="required"/>
              <xs:attribute name="category" type="xs:string" use="required"/>
              <xs:attribute name="subCategory" type="xs:string" use="required"/>
         </xs:complexType>
         <xs:element name="root">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="dataset" type="datasetType" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Now I want to define the referenceFunction/@category attribute of the dataset to be a foreign key to the categories table. Is it possible at all to do that with constraints? After failing with the nested table approach I really do not have any clue I would greatly appreciate any hints.
    Thanks,
    oli

    Nested tables do not currently support referential integrity.
    Foreign Keys on elements with maxOccurs > 0

  • Controlling Entity Posting Order to Avoid Constraint Violations

    Hi all,
    I am using Jdeveloper 11.1.1.2.
    I want to create a row in a master table, then when I commit, I want automatically creating a Row in its detail table.
    I am following the instructions of the paragraph 38.8 Controlling Entity Posting Order to Avoid Constraint Violations of the manual.
    I have a problem when I write:
    myTable.setNumberField(NumberField);
    compiling, I have this error: myTable.setNumberField(Number) cannot invoke myTable.setNumberField(oracle.jbo.domain.Number) in myTableEOImpl
    I have created myTableEOImpl.java automatically, using the java tab in myTableEO
    How can I solve it?
    Andrea

    Hi,
    you must make sure that data types passed to an Oracle ADF BC Number field are pf type oracle.jbo.domain.Number. Often developers forget to import this class and use Java lang Number instead
    Frank

  • What is the table to get the all planned orders related to a sale order

    Hi,
    May i know what is the table to get the all planned orders related to a sale order. My scenario is make to order scenario. we can get my out put final product by completing the nearly 916 planned orders.(Like major assemble,sub assemble). From this scenario i want the total orders related to a sale order. ( The planned orders from sale order to sale order will change. i.e 1 sale order will have 916 planned orders and one sale orders will generate 920 like that will chage when running mrp.). Now i want to pick the total planned orders for a sale order in a report. please guide me.
    Regards,
    Mastan.

    Hi,
    Use the table PLAF... in this table pass the sale order no in the filed KDAUF and then execute...issue here is once the planned orders are converted production orders, these planned orders are deleted from the system....so you will not able to see them.....
    Thanks
    Kumar

  • IN which table stores the Value of sales orders Net Value

    IN which table stores the Value of sales orders Net Value

    Hi Lakshmi,
    Check Following Tables:
    CRMD_PRICING_I
    CRMM_PR_SALESA
    CNCCRMPRSAP00090
    Reward Points if Helpful.
    Srini.

  • "Posting with reference to pur. order only possible for integrated whse"

    When I try posting GR with mvmt type 101 wrt PO  I am receiving the error “Posting with reference to pur. order only possible for integrated whse”
    The scenario is  storage lcation is maintained  with the external warehouse management .
    Is there anything i need to maintain warehouse as decentralised one or should i need to maintain any moment types or is there anything else i should maintain in the customisation.
    Kindly guide me regarding this as I am new to WM ,Thanks in advance.

    Hi ,
    In my case i have not maintained as decentralised one.
    also the thing is  there is no warehouse house  data managed over here .the requirement is when connected to extended warehouse  the system has to create inspection lot after the GR has done ,
    whereas in normal scenario everything is normal,
    can you please suggest what should be done in this case.
    Also if possible can you please tell me what from the scratch so that it will be helpful to come through .

  • In which table invoices related to a purchase order are stored ?

    Hi all,
    We need to make an ABAP program and I need to know in which table the invoices made by MIRO related to a purchase order are stored.
    I can see them in the purchase order history tab in the transaccion ME23N but giving F1 and getting the table names gives me a structure table but not the actual table in SAP database. I tried the BSEG table but it doesn't store the purchase order number. Any information will be highly appreciated.  
    Thanks !!

    Hi
    You can get the Link of PUrchase order & the Invoice from Table EKBE.
    You can also get the data by joining the table RBKP & RSEG, as the Purcahse order details are stored in RSEG & posting date details are stored in RBKP
    Thanks & Regards
    Kishore

  • Table containeing both the purchase order number and the sales order number

    hi all!!!
    what is table that contains both the purchase order number and sales order number corresponding to that purchase order number.
    Moderator message: please search before posting.
    Edited by: Thomas Zloch on Jan 31, 2012

    Hi Sunny,
    Yes they are same. You will be creating a purchase order in ME21n. After creating purchase order you will shown a number for that order.
    Reward points if useful.
    Thanks,
    Swamy Kunche

  • Not able to include PM order type PM03 in integration model

    Hi Experts,
    I am creating PM order in R/3 with order type PM03. But while creating the integration model for maintaince order, PM03 is not populating. and others I am getting like PM01, PM02 etc...
    Please advise if I need to do some setting for the same.
    Thanks
    Hitesh

    Hi,
    Request you to cross check whether the PM03 order type has the below two check box active  in IMG. 9 Tcode = OIOA
    Open Item Management and Release Immediately.
    PM03 order type with the above settings are getting reflected for me in my integration model.

  • Forward Orders in SAP/RB Integration

    Hi,
    We are running a SBO2007A and Radio Beacon 54.12 integration.
    We have a situation where we have forward orders placed against certain seasonal products. For example, winter stock might be ordered by our customers 8 months in advance and we then plan our buying based on this.
    When the stock for these forward orders arrives, we want to allocate this stock to the forward orders as a higher priority than regular orders for this stock as they have placed their orders well in advance.
    The process we have used so far is keying the forward sales orders into a seperate virtual warehouse, then receiving the stock into that warehouse, so it can't be allocated to normal orders.
    Our problem is it is not practical for us to use Radio Beacon to dispatch out of this virtual warehouse because we need to print seperate bin labels etc.  If we move the stock and orders from the virtual warehouse to the main warehouse, we still have the risk of the stock being allocated to regular orders ahead of the forward orders.
    Does anyone have any suggestions as to a process we could use?
    Thanks,
    Michael

    Michael,
    I don't think there is any way in SAP to hard allocate an Item to a Particular Order.  The option you have is to create a BIN / allocate a BIN for these order and make them non-pickable.  Once you do this RB cannot allocate from these Bins for other Orders.  Once it is time to ship this order then you do an Bin move and ship it from there.
    Suda

  • Table name& field name for production order  & operation confirmation

    Hi All,
              I would like to know the table name and field name for the production order "confirmation" (CNF) and the operation confirmation (CNF).
    Thanks and Regards,
    PSS

    Hi there,
    CORU(R/3 Application development: PP Confirmations )
    AFFW       Goods movements with errors from confirmatio
    AFRC       Table of planned changes to conf.: Automatic
    AFRD       Default values for collective confirmation 
    AFRH       Header information for confirmation pool   
    AFRP1      Table of planned changes to conf.: Automatic
    AFRP2      Table of planned changes for confirmation: B
    AFRP3      Table of planned changes for confirmation: C
    AFRP4      Table of planned changes to confirmatn: Data
    AFRU       Order completion confirmations             
    AFWI       Subsequently posted goods movements for conf
    TAFWD      CORU: Messages that are not interpreted as e
    TCORD      Table for field-dependent check routines   
    TCORU      Parameters for order confirmations         
    TCORV      Table with Routines for structureing variabl
    TCORW      Confirmation: Window Control               
    TPARU      Control parallelized confirmation processes
    TPRRU      Control table for process chain for confirma
    TPRRUT     Text table for process control of confirmati
    TRUGS      User status caused by deviation            
    CO(R/3 Application development: PP Production orders )
    AFBP        CIM order: Batch print requests            
    AFFL        Work order sequence                        
    AFKO        Order header data PP orders                
    AFPO        Order item                                 
    AFVC        Operation within an order                  
    AFVU        DB structure of the user fields of the opera
    AFVV        DB structure of the quantities/dates/values
    FAPW        Index of production-/issuing plant for produ
    FTIND       Missing parts index                        
    ORDCOM      Communication control Operation download   
    T024F       Production scheduler                       
    T399X       Parameters dependent on order type         
    T441C       Profile - availability check               
    T441CT      Texts for Profile "Display Availability Chec
    T490        Transactions PP - orders - order category  
    T496B       CIM order: Assigning document types to refer
    T496D       CIM: Destination/lists/spool parameters per
    T496F       CIM order: Form description of the list    
    T496K       CIM order: Entity table of possible table id
    T496N       CIM order: List descriptions               
    T496P       Print PP documents: Determination of output
    T496R       Print PP shop papers: Report control       
    T496T       Print PP shop papers: Transaction control  
    T496V       PP Print: Default Value for Printing Online
    T496Z       CIM order: Table-controlled table access   
    TC32        Assigning subscreen to processing location 
    TC34        Allocating operation to object type for the 
    TC62        Sequence of detail screens when processing h
    TCO01       Sequence/operations control in logicstics or
    TCO03       CIM order: Texts for TCO01, Description of o
    TCO04       Table for controlling the screen sequence gr
    TCO05       CUA status depending on panel, trans. type, 
    TCO06       Exclusive functions for PP orders           
    TCO09       CIM order: Text IDs of objects in orders    
    TCO10       Valuation variant for order costing         
    TCO11       Control table for production orders - availa
    TCO12       Control table production orders - stock dete
    TCO36       PP orders: Control table for calling up pop-
    TCO41       CIM order: Default values for generating ope
    TCO43       PP-SFC order profile                        
    TCO43T      Description of production scheduler profile 
    TCO60       Sequence keys for input facility and verific
    TCO61       Sequence key for PP orders                  
    TCO62       Defining screen sequences for input facility
    TCO63       Sequence of detail screens when maintaining 
    TCODB       Database fields development class CO per ord
    TCOF        Profile for missing parts info system       
    TCOFF       Profile for Missing Parts Info System: Displ
    TCOFFT      Texts for Missing Parts Info System: Display
    TCOFG       Profile for missing parts info system: crite
    TCOFGT      Texts for Missing Parts Info System: Criteri
    TCOFK       Texts for functions in milestones/trigger po
    TCOFS       Profile for Missing Parts Info System: Sort
    TCOFST      Texts for Missing Parts Info System: Sort Cr
    TCOFT       Texts for Missing Parts Info System        
    TCOKO       Constants for PP orders                    
    TCOKT       Account assignment categories for order    
    TCOP        Field selection profile                    
    TCOPS       Field selection profile                    
    TCOPT       Description of Profile for Field Selection 
    TDUMMY      Dummy structure of a table for READ with VER
    TRUG        Reason for variances in completion confirmat
    TRUGT       Text describing the reason for a variance in
    TXPR1       XPRA control - missing parts info system   
    Regards
    Hemant G

  • Which table could let me check sales order type when giving dlv order info

    Hi,
    Suppose you got the delivery order detail like delivery number#,dlv type...etc...
    From which table link could we find the corresponding sales order type???
    Is there any table indicate the document flow, and with that then i could find the sales order type for this dlv order???
    Thank you very much!!

    Hi Ram,
    Could kindly indicate which field could link LIKP and VBAK directly..Thank you very much...
    Maybe below way is not the fast way...
    1)     Get sales order number with dlv# by checking document flow table VBFA.
    2)     Get Sales order type by checking tbl VBAK with sales order number.

  • Can u tell me the tables for field Cross company Purchase Order.

    Can u tell me the tables for field Cross company Purchase Order.

    check below link...
    http://help.sap.com/bp_bblibrary/500/Documentation/J53_BPP_EN_DE.doc

Maybe you are looking for

  • How to create index file for pdf.

    Hello, I need to create a plugin which will read a list of pdf files and then create a full text index with catalog. I searched on net and came to know about the catalog plugin which does this work.In AV layer there is a catalog object but I am unabl

  • Help with Over

    Greetings everyone, I'm trying to use the over function but with two sums, the point is to get the points of a sum to make a graphic that goes up and down depending on this values. This is the first part thats working SELECT {RegistoDeposito}.[Data],

  • Pricing type in copy control

    Hi experts, I want to copy pricing elements unchanged from order to billing for this I have maintained pricing type " D - copy pricing elements unchanged  in copy control from delivery to billing at item level. Still the system is carrying out new pr

  • Are there benefits to migrating an old iMac from 10.3.9 to 10.4x .....

    ...... I'm giving it to my Mom. She will primarily be using email and a little bit of Sarfari for browsing and viewing pics in iPhoto. Is there a difference or should she be OK with 10.3.9? What is the cost of going to 10.4x? Thanks

  • How can I back up in time on a Mac OS X 10.4.11?

    How can I back up in time on a Mac OS X 10.4.11?