Can I create a foreign key when creating Business Components from Tables

Hi,
I would like to use ADF and JSF to create an application on our database. My problem is our database does not "conform". i.e. there are no foreign key constraints.
When I create a "Business Component from Tables" view, can I put in my own joins between tables so enabling the use of the generated views?
Jon L.

View object instances show up in the data control palette once you've added them to your application module's data model.
See these sections in the ADF Developer's Guide for more information:
Section 2.6.3, "Using View Objects in the Application Module's Data Model" talks about using view object instance in the data model as part of the overview chapter.
Section 4.5, "Understanding the Active Data Model" explains a little more about this
Section 5.3, "Using a View Object in an Application Module's Data Model" shows how to do this.
Chapter 10, "Overview of Application Module Data Binding" gives details on how the application and its view objects are exposed in the Data Control palette.
You can find the guide on the ADF Learning Center on OTN.
http://www.oracle.com/technology/products/adf/learnadf.html
Look for the ADF Developer's Guide for Forms/4GL Developers.

Similar Messages

  • Unable to choose foreign key when creating reference partition

    Hello
    I have 2 foreign keys on a table. I am trying to choose the 2nd foreign key when creating a reference partition. I am unable to select the required foreign key.
    The model has Table A -> Table B -> Table C. Table A has a list partition. Table B is the child of Table A. I created a reference partition on Table B. Table C is child of Table B. There are 2 FKs on table C. I am unable to choose the required FK to create reference partition on table C.
    SQL Developer version - 3.0.0.665
    Any help would be appreciated.

    Hi,
    The FK that can be selected is normally the oldest FK that was created for the Table.
    So one option would be to delete and then recreate the FK that is selectable. This process may need to be repeated if there are several FKs that are "older" than the one you wish to use for Reference Partitioning.
    David

  • NO Links or Associations created with the "Business Components From Tables"

    Hello,
    I have a strange problem. I'm working on a Fusion Web Applicaiton. In the Model project, I try to create some Business Components from Tables with the help of the provided wizard.
    I select one of my IDE Connections, and I choose two of my tables as Entity Objects (*PATIENTS* and COUNTRIES - more details about them bellow), and also as Updatable View Objects. For Read-Only View Objects I select some other tables, afterwards I choose to create a default Application Module, and I press Finish without creating a Business Diagram. Everything works perfectly except of the fact that the wizzard has created everything but the Links and the Associations between my tables.
    To be more precise, COUNTRIES is a simple table, only two columns - ID and NAME, and PATIENTS has some columns like ID, NAME, ADDRESS, DATE_OF_ADMISSION, COUNTRY_ID, where COUNTRY_ID is a foreign key to the COUNTRIES table. Both columns, PATIENTS.COUNTRY_ID and COUNTRIES.ID are NUMBERs. I was expectig the wizard to create a Link and a Association for this foreign key constraint I have between this two tables.
    On the other hand, following one of the tutorials I've found, *"Developing RIA Web Applications with Oracle ADF"*, I've noticed that when I was creating Business Components from Tables based on the HR schema, all the Links and Associations were created as they were expected. I've also tried to create the same Business Components from Tables in my own project, and all the Links and Associations were in place. Somehow, it's not working for my particular schema (the one that contains PATIENTS and COUNTRIES).
    Is there something I do wrong? I've made sure that all the FK constraints are enabled, alive and kicking. From my point of view, the tables are working and behavig as they should, but I can't understand why that feature of automatically creating the Links and Associations works on the HR schema but not on mine.
    Please help!
    Bogdan.
    PS: I am using Oracle JDeveloper Studio Edition Version 11.1.1.1.0, Oracle SQL Developer Version 1.5.5, and Oracle 10g Express Edition installed on localhost.

    Hello John,
    Of course I can post the scripts.
    The schema name is "TEST". But you should know that there are some extra columns in the PATIENTS table, I've not mentioned before. As you can tell from the scripts bellow, the PATIENTS table has the following columns: ID (number), NAME (varchar2), COUNTRY (number), GENDER (number), ADMISSIONDATE (date), DIAGNOSTIC (number), FIRSTNAME (varchar2), SALARY (number). There are actually 3 FK constraints, I've only mentioned one for the simplifying the example. The first FK constraint is towards COUNTRIES, the second one is towards GENDERS, and the final one is towards DIAGNOSTICS. All this 3 tables have only two columns (ID as number, and GENDER as varchar2). I will post the scripts for all.
    Here is the output of the Export DDL to Clipboard from SQL Developer for the COUNTRIES table:
    CREATE TABLE "TEST"."COUNTRIES"
    (     "ID" NUMBER NOT NULL ENABLE,
         "NAME" VARCHAR2(1000 BYTE) NOT NULL ENABLE,
         CONSTRAINT "COUNTRIES_UK1" UNIQUE ("NAME")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE,
         CONSTRAINT "COUNTRIES_PK" PRIMARY KEY ("ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."COUNTRIES_PK" ON "TEST"."COUNTRIES" ("ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."COUNTRIES_UK1" ON "TEST"."COUNTRIES" ("NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE OR REPLACE TRIGGER "TEST"."COUNTRIES_TRG"
    BEFORE INSERT ON COUNTRIES
    FOR EACH ROW
    BEGIN
    SELECT COUNTRIES_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
    END;
    ALTER TRIGGER "TEST"."COUNTRIES_TRG" ENABLE;
    Here is the same output for the GENDERS table:
    CREATE TABLE "TEST"."GENDERS"
    (     "ID" NUMBER NOT NULL ENABLE,
         "NAME" VARCHAR2(50 BYTE) NOT NULL ENABLE,
         CONSTRAINT "GENDERS_PK" PRIMARY KEY ("ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE,
         CONSTRAINT "GENDERS_UK1" UNIQUE ("NAME")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."GENDERS_PK" ON "TEST"."GENDERS" ("ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."GENDERS_UK1" ON "TEST"."GENDERS" ("NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE OR REPLACE TRIGGER "TEST"."GENDERS_TRG"
    BEFORE INSERT ON GENDERS
    FOR EACH ROW
    BEGIN
    SELECT GENDERS_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
    END;
    ALTER TRIGGER "TEST"."GENDERS_TRG" ENABLE;
    Here is the same output for the DIAGNOSTICS table:
    CREATE TABLE "TEST"."DIAGNOSTICS"
    (     "ID" NUMBER NOT NULL ENABLE,
         "NAME" VARCHAR2(1000 BYTE) NOT NULL ENABLE,
         CONSTRAINT "DIAGNOSTICS_PK" PRIMARY KEY ("ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE,
         CONSTRAINT "DIAGNOSTICS_UK1" UNIQUE ("NAME")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."DIAGNOSTICS_PK" ON "TEST"."DIAGNOSTICS" ("ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."DIAGNOSTICS_UK1" ON "TEST"."DIAGNOSTICS" ("NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE OR REPLACE TRIGGER "TEST"."DIAGNOSTICS_TRG"
    BEFORE INSERT ON DIAGNOSTICS
    FOR EACH ROW
    BEGIN
    SELECT DIAGNOSTICS_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
    END;
    ALTER TRIGGER "TEST"."DIAGNOSTICS_TRG" ENABLE;
    And finally, here is the same output for the PATIENTS table:
    CREATE TABLE "TEST"."PATIENTS"
    (     "ID" NUMBER NOT NULL ENABLE,
         "NAME" VARCHAR2(1000 BYTE) NOT NULL ENABLE,
         "COUNTRY" NUMBER,
         "GENDER" NUMBER,
         "ADMISSIONDATE" DATE,
         "DIAGNOSTIC" NUMBER,
         "FIRSTNAME" VARCHAR2(1000 BYTE),
         "SALARY" NUMBER,
         CONSTRAINT "PATIENTS_PK" PRIMARY KEY ("ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE,
         CONSTRAINT "PATIENTS_UK1" UNIQUE ("NAME", "ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE,
         CONSTRAINT "PATIENTS_GENDERS_FK1" FOREIGN KEY ("GENDER")
         REFERENCES "TEST"."GENDERS" ("ID") ENABLE,
         CONSTRAINT "PATIENTS_DIAGNOSTICS_FK1" FOREIGN KEY ("DIAGNOSTIC")
         REFERENCES "TEST"."DIAGNOSTICS" ("ID") ENABLE,
         CONSTRAINT "PATIENTS_COUNTRIES_FK1" FOREIGN KEY ("COUNTRY")
         REFERENCES "TEST"."COUNTRIES" ("ID") ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE INDEX "TEST"."PATIENTS_INDEX1" ON "TEST"."PATIENTS" ("NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."PATIENTS_PK" ON "TEST"."PATIENTS" ("ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE UNIQUE INDEX "TEST"."PATIENTS_UK1" ON "TEST"."PATIENTS" ("NAME", "ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    CREATE OR REPLACE TRIGGER "TEST"."PATIENTS_TRG"
    BEFORE INSERT ON PATIENTS
    FOR EACH ROW
    BEGIN
    SELECT PATIENTS_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
    END;
    ALTER TRIGGER "TEST"."PATIENTS_TRG" ENABLE;
    If a complete DB dump would be more helpful, please let me know. I am willing to provide any details.
    Thanks for your support.

  • Creating a foreign key constraint on a synonym of table in another schema.

    Hi,
    I am having two user operapps and oper
    owner of table po_vendors is operapps ,i have created a synonym in oper with select permission.
    now i am trying to create a foreign key.
    ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID));
    the bolded po_vendors is the synonym for the table po_vendors in operapps.
    i am getting the below error message.
    SQL> ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID));
    ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID))
    ERROR at line 1:
    ORA-01031: insufficient privileges.
    i have given dba privileges to oper user.
    Please advice.

    1) You cannot create a constraint on a synonym. You have to specify a physical table (i.e. OPERAPPS.PO_VENDORS)
    2) The owner of the OPS_BR_VENDORS table will need to have the REFERENCES permission on the PO_VENDORS table granted directly (not via a role).
    Justin

  • How to create a Foreign key relationship between 2 user defined tables...

    Hi Folks,
    I have created two user defined tables... Where in i want to create foriegn key relationship between the 2 tables.... Can anyone guide the step by step procedure to do this scenario...
    Any help would be highly appreciated...
    Thanks

    Hi
    1.  In the 2nd table call the field of the 1st table which is a primary key.
    2.  Give the same field and dataelement name.
    3.  Select that field and then click on the foreign key field icon which is beside Search Help button.
    4. Then give short text, and the 1st table name.
    5. Then in the below box give the 2nd table name and 2nd table field name which you have called from 1st table.
    6. Then click on copy, then u will be able to see Check table name and check table field name beside foreign key table name.
    7. Then again click on copy.
    Regards
    Haritha.

  • Error While Create Business Components From Tables Wizard -- need help asap

    Hi , i have created a view and while create Business Components through wizard for that view i am getting following error.
    ENTITY CREATION FAILED FOR THE FOLLOWING DATABASE OBJECT
    NO PRIMARY KEY ATTRIBUTES AND DOES NOT SUPPORT ROWID . USE ENTITY WIZARD TO CREATE THE ENTITY OBJECT.
    very urgent.
    Regards
    bhanu prakash

    thanks shay .
    Jdeveloper version :: 10.1.3.1.0
    view Syntax is :
    SELECT
    oh.order_number||'- ('||ol.line_number||'-'||ol.shipment_number||')' so_line,
    oh.cust_po_number customer_po,
    ol.flow_status_code status,
    ol.shipping_method_code carrier,
    ol.ordered_item item_no,
    nvl(xxapplication_express_pkg.getcustomerpart(ol.inventory_item_id, hca.cust_account_id), ' ') customer_item_number,
    nvl(mtl.description , 'na') description,
    nvl(org.organization_name , 'oak park') ship_from,
    hcsu.location||' ('||hl.city||' '||hl.state||' '||hl.postal_code||')' ship_to,
    nvl(ol.promise_date, sysdate) promised_date,
    nvl(ol.ordered_quantity, 0) order_quality ,
    xxapps.xx_eg_calculated_onhand(ol.line_id) available_qty,
    nvl(ol.shipped_quantity, 0) shipped_quality ,
    ol.order_quantity_uom uom,
    hp.party_name customer_name,
    jrs.name sales_person_name,
    0 refer
    FROM
    oe_order_headers_all oh,
    oe_order_lines_all ol,
    hz_cust_accounts hca,
    hz_parties hp ,
    hz_cust_site_uses_all hcsu,
    hz_cust_acct_sites_all hcas,
    hz_party_sites hps,
    hz_locations hl,
    org_organization_definitions org ,
    mtl_system_items_b mtl ,
    jtf_rs_salesreps jrs
    WHERE
    oh.header_id = ol.header_id and
    oh.org_id = ol.org_id and
    oh.sold_to_org_id = hca.cust_account_id and
    hca.party_id = hp.party_id and
    hcas.cust_account_id = hca.cust_account_id and
    hcsu.cust_acct_site_id = hcas.cust_acct_site_id and
    hcas.party_site_id = hps.party_site_id and
    hps.location_id = hl.location_id and
    hcsu.site_use_id = oh.ship_to_org_id and
    hcsu.site_use_code = 'SHIP_TO' and
    org.organization_id = ol.ship_from_org_id and
    org.organization_id = mtl.organization_id and
    ol.inventory_item_id = mtl.inventory_item_id and
    ol.ship_from_org_id = mtl.organization_id and
    ol.salesrep_id = jrs.salesrep_id and
    ol.org_id = jrs.org_id
    Regards
    Bhanu Prakash

  • Creating Business Components from Teradata tables

    I'm trying to use the "business components from tables" wizard using a connection to a Teradata database. The business components get created without attributes. I'm getting an error where JDeveloper thinks that the Teradata table doesn't have a primary key. But I explicitly created the primary in the table (not be confused with a primary index, which is a different object from a Primary Key in Teradata). Am I really not supposed to use ADF to deal with Teradata data stores? I was hoping ADF would be able to work with databases other than Oracle. Is there maybe something special that needs to be done for the business components wizard to be able to recognize the primary key in the Teradata table? If we need to create all Teradata business objects manually then ADF isn't a goo option for Teradata.

    I'm connecting via JDBC Generic. I'm using Teradata's JDBC driver. From a connection perspective everything works fine. I have the Teradata connection both as an IDE resource as well as an Application resource. When I expand the application connection it shows all schemas. I then expand my personal schema where I created the table with which I'm testing. It shows my table, all the table's columns, and under constraints it shows the table's primary key. But when I try to create the business components is when it somehow doesn't seem to recognize the table's primary key.

  • Questions about creating a foreign key on a large table

    Hello @ll,
    during a database update I lost a foreign key between two tables. The tables are called werteart and werteartarchiv_pt. Because of its size, werteartarchiv_pt is a partitioned table. The missing foreign key was a constraint on table werteartarchiv_pt referencing werteart.
    Some statistics about the sizes of the mentioned tables:
    werteart 22 MB
    werteartarchiv_pt 223 GB
    werteartarchiv_pt (Index) 243 GB
    I tried to create the foreign key again, but it failed with the following error (Excuses for the german error message):
    sqlplus ORA-00604: Fehler auf rekursiver SQL-Ebene 1
    sqlplus ORA-01652: Temp-Segment kann nicht um 128 in Tablespace TEMPS00 erweitert
    The statement I used:
    alter table werteartarchiv_pt
    add constraint werteartarchiv_pt_fk1
    foreign key (schiene, werteartadresse, merkmale)
    references werteart (schiene, werteartadresse, merkmale)
    on delete cascade
    initially deferred deferrable;
    So the problem seems to be, that Oracle needs a lot of temporary tablespace to generate the foreign key and I do not know how much and why.
    My questions now are, and hopefully someone is here, who can answer all or a part of it:
    1) Why does Oracle need temporary tablespace to create the foreign key? The foreign key uses the same columns like the primary key.
    2a) Is it possible to tweak the statement without using the temporary tablespace?
    2b) If it is not possible to avoid the usage of the temporary tablespace, is there a formula how to calculate the needed temporary tablespace?
    3) Is it possible to modify data in the tables while the foreign key is created or is the whole table locked during the process?
    Any help or hint is appreciated.
    Regards,
    Bjoern

    RollinHand wrote:
    My questions now are, and hopefully someone is here, who can answer all or a part of it:
    1) Why does Oracle need temporary tablespace to create the foreign key? The foreign key uses the same columns like the primary key.Because it's validating the data to ensure the foreign key won't be violated. If you had specified ENABLE NOVALIDATE when creating it then the existing data in the table wouldn't need to be checked and the statement should complete instantly (future data added would be checked by the constraint).
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general005.htm
    Search for "Enable Novalidate Constraint State"

  • I am unable to create the Foreign key

    Hi,
    I need to create the Foreign key which reffered to composite primary key.
    the following table structure
    Parent table
    DIVISION, PROJECT_NUMBER, COMPETITION_PROJECT_NUMBER, COMPETITIVE_STMT_TYPE, SEQUENCE, CATEGORY, STATEMENT, USER_ID, RECORD_MODIFICATION_DATE
    Here composite primary key columns(DIVISION, PROJECT_NUMBER, COMPETITION_PROJECT_NUMBER, COMPETITIVE_STMT_TYPE, SEQUENCE)
    Child Table
    DIVISION          VARCHAR2 (4)          
    PROJECT_NUMBER          NUMBER (10)COMPETITION_PROJECT_NUMBER     NUMBER (10)          
    COMPETITIVE_STMT_TYPE          VARCHAR2 (2)          
    SEQUENCE     NUMBER (2)          
    CATEGORY          VARCHAR2 (100)     
    STATEMENT     LONG          
    USER_ID     VARCHAR2 (100)          
    RECORD_MODIFICATION_DATE     DATE     
    ALTER TABLE COMPETITION_STMT ADD (CONSTRAINT COMPET_STMT_FK_PROJ_NUM foreign key
              (PROJECT_NUMBER) REFERENCES PROD_COMPET_XREF (PROJECT_NUMBER));
    when i am trying to create foreign key i got this error
    ORA-02270: no matching unique or primary key for this column-list
    this is production issue Please help me.
    Thanks in advance
    Regards
    Kumar.s

    ALTER TABLE PROD_COMPET_XREF ADD (
    CONSTRAINT PROD_COMP_XREF_PK_DPNCPNCT
    PRIMARY KEY
    (COMPETITION_PROJECT_NUMBER, PROJECT_NUMBER, DIVISION, PRODUCT_LOC_INDICATOR)
    When you create a foreign key, it must reference a unique or primary key. The primary or Unique key must consist ONLY of those columns upon which the Primary key is based.
    You must Alter the table and add a Unique key if you want to keep your compsite primary key constraint. The Unique key must be for only the column that your foreign key references. Then try to recreate your foreign key.
    I doubt you will be able to add a foreign key because I suspect you might have multiple rows with the same value for this column based on your composite key; however, if you only intend for the project number to be listed only once and to be unique for each row, then the unique key may work or you may want to revist your primary key on this table. Perhaps you don't need it to be a composite PK???
    If you can't work around that, one thing you can do is build a table based just on PROJECT_NUMBER that contains details about the project number and have other tables reference that. That is, if you have multiple rows with the same project number in that table. You may already have one? Perhaps you can build your foreign key to reference that?

  • Create a foreign key from a field that is part of a mulitple primary key

    Hi,
    i had a table named T_A, with a double primary key : (A,B)
    Then i created a table named T_B with a field : C.
    I want this field T_B.C to take only values that already exist in field T_A.A.
    So i tried to create a foreign key on my field T_B.C, pointing on the field T_A.A : an error message appeared "not possible to create a foreign key on a field that is not a primary key".
    How can i solve this....? If U have any idea, please mail me !!
    THANX very much.

    Add column A as foreign key into the table T_BHow?
    (was the question from the original poster. Adding a column to table T_B that happen to have same name as the corresponding column in table T_A would not allow you to add the foreign key).
    SQL> create table t_a (a number, b number, primary key(a, b)) ;
    Table created.
    SQL> create table t_b(a number, c number, constraint foreign key references t_a(a)) ;
    create table t_b(a number, c number, constraint foreign key references t_a(a))
    ERROR at line 1:
    ORA-02270: no matching unique or primary key for this column-list
    SQL>

  • How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    For my part you are welcome, sdowers.
    Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
    I just came to remember a warning that needs to be given:
    The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25.

  • Can't select "include book documents" when creating index in InDesign CC

    I'm trying to make an index for several dokuments in a book. I've made the index but when I try to generate the index the checkbox is greyed out so I can't check it. Do You know what's wrong?

    Thank You. That worked well.
    One more question: It looks as if the index does not include the words of all the documents in the book. Is it something I do wrong?
    Thanks
    Henning
    Fra: Peter Spier <[email protected]<mailto:[email protected]>>
    Svar til: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Dato: onsdag 10. juli 2013 13:04
    Til: Henning Kristoffersen <[email protected]<mailto:[email protected]>>
    Emne: Can't select "include book documents" when creating index in InDesign CC
    Re: Can't select "include book documents" when creating index in InDesign CC
    created by Peter Spier<http://forums.adobe.com/people/P+Spier> in InDesign - View the full discussion<http://forums.adobe.com/message/5491834#5491834

  • We have a 5s active on our account.  After turning on a previously active 4s (it had the same number)  The 5s can no longer place call and when you call it from another phone the 4s rings, but will not pick up.  Texting over the cell networks works fine.

    We have a 5s active on our account.  After turning on a previously active 4s (it had the same number)  The 5s can no longer place call and when you call it from another phone the 4s rings, but will not pick up.  Texting over the cell networks works fine.  Any suggestions??

    hens0861,
    Hmm, let's ensure this is working as it should be! So what phone should be active on your account? Did you switch the devices online or how to did you activate the 5s? Please share details.
    KarenC_VZW
    Follow us on Twitter @VZWSupport

  • How to find out when data was deleted from table in oracle and Who deleted that

    HI Experts,
    Help me for below query:
    how to find out when data was deleted from table in oracle and Who deleted that ?
    I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
    SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
    TABLE_OWNER                    TABLE_NAME                        INSERTS    UPDATES    DELETES     TIMESTAMP         DROP_SEGMENTS TRU
    PRODCTL                        F9001                                                     1683         46       2171            11-12-13 18:23:39             0                   NO
    Audit is enable in my enviroment?
    customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
    SQL> show parameter audit
    NAME                                 TYPE        VALUE
    audit_file_dest                      string      /oracle/admin/pbowe/adump
    audit_sys_operations                 boolean     TRUE
    audit_syslog_level                   string
    audit_trail                          string      DB, EXTENDED
    please help
    Thanks
    Sam

    LOGMiner --> Using LogMiner to Analyze Redo Log Files
    AUDIT --> Configuring and Administering Auditing

  • How to create a foreign key for the table from two different tables?

    Hi All,
    I have a three table like below. In the below table SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK will be having the primary key for NAME column. The same SAMPLE_CONS3_CHECK table also having the primary key for NAME column and forieign key for SAMPLE_CONS_CHECK and SAMPLE_CONS2_CHECK tables. See the below code 2
    code 1:
    CREATE TABLE SAMPLE_CONS_CHECK
            (NAME VARCHAR2(10),
            SERIES  VARCHAR2(5)
    CREATE TABLE SAMPLE_CONS2_CHECK
            (NAME  VARCHAR2(5),
             MODEL  NUMBER
    CREATE TABLE SAMPLE_CONS3_CHECK
            (NAME  VARCHAR2(5),
             MODEL_NO  NUMBER
            )code 2
    alter table SAMPLE_CONS_CHECK
    add constraint SAMPLE_CONS_CHECK_pk primary key (NAME)
    alter table SAMPLE_CONS2_CHECK
    add constraint SAMPLE_CONS2_CHECK_pk primary key (NAME)
    alter table SAMPLE_CONS3_CHECK
    add constraint SAMPLE_CONS3_CHECK_pk primary key (NAME)
    ALTER TABLE SAMPLE_CONS3_CHECK ADD
    CONSTRAINT SAMPLE_CONS3_CHECK_FK1 FOREIGN KEY
         NAME
    ) REFERENCES SAMPLE_CONS_CHECK
        NAME
    ) ON DELETE CASCADE;
    ALTER TABLE SAMPLE_CONS3_CHECK ADD
    CONSTRAINT SAMPLE_CONS3_CHECK_FK2 FOREIGN KEY
         NAME
    ) REFERENCES SAMPLE_CONS2_CHECK
        NAME
    ) ON DELETE CASCADE;From the above schenario i am able to insert the data to SAMPLE_CONS3_CHECK table. But the parent data is already available in the parent table. The problem is here two different constarints from two different tables. While inserting, it is checking from both the tables whether the parent is exist or not.
    How can i solve this problem? Can anyone halp me about this?
    Thanks
    Edited by: orasuriya on Aug 8, 2009 2:02 AM

    Actually the design is completely incorrect.
    What you say is
    I have
    'foo', 'foo series'
    'foo','foo model'
    'foo',666
    By virtue of table3 referring to both table1 and table2.
    This means you actually need to have 1 (one) table:
    'foo','foo series','foo model', 666
    And the 'problem' disappears.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • I have 200 Gig of "Other"

    Before downloading Mt Lion, I had more than 3/4 of my HD available. Now I have near to nothing because I have 200 GIG of Other. What the **** is it and how do I deal with it? The computer is running fine, but I suspect in a while it won't be. Surely

  • Auto commit in JDeveloper SQL Worksheet

    Can anybody tell me how to turn OFF the autocommit in SQL Worksheet withing JDeveloper, Many Thanks in advance, Ian

  • Read Me

    Hello hello hello I have uno probleeemo. Me is trying to write a program that reads in keypresses. Stores them and when a button is clicked it dumps them into a text area. I've written it and it works but.............. I want the program running in t

  • Server 2012 DC behind NAT

    We have 2 sites, each with 2 domain controllers. The main site is with our servers in a hosted datacenter. We have an IPsec VPN tunnel setup between the sites, but the datacenter host does not add routes on their end for the tunnel. So the only way f

  • MIGO ERROR:- 10020 ORD belong to business area 1111 not 1112

    Hi All, I am facing an error while doing MIGO for an import PO. Error is below:- 10020 ORD belong to business area 1111 not 1112 Message no. KI188 Diagnosis Account assignment object 10020, type ORD is assigned to business area 1111. You made an expl