Mapping error at deployment with foreign key data rule

I have created data rules for enabling foreign key constraints. There are 4 foreign key constraints on the fact table.
For the 1st foreign key ... its a single key match key1 on table 1
For the others, its a composite key .. key1 and key2 on table 2
key1 and key3 on table 3
key1 and key4 on table 4
When I implement with the single key foreign key constraint the mapping works fine. But when I apply the other foreign key data rules for composite keys, I get the following message while deploying ....
M_CNT Create Warning ORA-06550: line 209, column 3:
PL/SQL: ORA-00909: invalid number of arguments
M_CNT Create Warning ORA-06550: line 520, column 65530:
PL/SQL: SQL Statement ignored
M_CNT Create Warning ORA-06550: line 56, column 65530:
PL/SQL: SQL Statement ignored
M_CNT Create Warning ORA-06550: line 673, column 3:
PL/SQL: ORA-00909: invalid number of arguments
The data rule setup done is type Referential
Specify the number of attributes in row relationship - 2
Specify the referencing cardinality of row relationship
Minimum Count 1 Maximum Count n
Specify the referenced cardinality of row relationship
Minimum Count 1 Maximum Count n
What is it that I am doing wrong ?
Any suggestions. Help !!!!
Regards,
AW

Hi AW,
How can I overcome this situation ?The best solution as suggested by Jörg is use of surrogate keys.
For every production key (composite or single) generate a corresponding surrogate key using sequence operator in staging area.
This will not just solve your problem but it will be faster also (the joins will be faster with system-generated sequence numbers),
In a data warehouse use of production keys as primary key for linking with (foreign key) is not recommended, keep the production keys as additional attributes.
Regards,

Similar Messages

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_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 "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_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 "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_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 "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • BEX - Get Open Items with a key Date

    Hi Gurus,
    Im working with the Cube and ODS for AR Line items (0FIAR_C03- 0FIAR_O03) and i need to create a report that shows the Open items by Customer with a Key Date.
    I did the query that shows all the open items by customer, and i want to know where can i put the filter to input a key date, and only shows the open items until that date.
    Thanks in advanced, i really appreciate your help

    Hi Marcos,
    When you have created the Restricted keyfigures for Open Items, You have to add the date characteristic on which you are looking open item and add the variable there.Here you have to use a variable of type Interval and select the operator "<" the date of the Variable.If you go through, there are standard variable for keydate, which you can use directly.
    Hope you got the idea
    Regards
    Happy Tony

  • Maintenance View for custom table with foreign key relationship

    Hi Folks,
         I have created a custom table with foreign key relationship with other check tables. I want to create a maintenance view / tablemaintenance generator. What all things I need to take care for the foreign keys related fields while creating the maintenance view / tablemaintenance generator.
    Regards,
      santosh

    Hi,
    You do not have to do anything explicitely for the foreign key relationships in the table maintainance generator.
    Create the table maintainance generator via SE11 and it will take care of all teh foreign key checks by itself.
    Regards,
    Ankur Parab

  • How to insert record in child table with foreign key

    Hi,
    I am using Jdeveloper 11.1.2.0. I have two master table one child table.
    How to insert and update a record in child table with foreign key ?
    I have created VO based on three EO(one eo is updatable other two eo are references) by using joined query.
    Thanks in Advance
    Edited by: 890233 on Dec 24, 2011 10:40 PM

    ... And here is the example to insert using sequenceimpl by getting the primary key of the master record and insert master and detail together.
    Re: Unable to insert a new row with a sequence generated column id
    -Arun

  • How to insert a new record to table with foreign key

    I have 3 tables like this :
    CREATE TABLE PERSON (
    PK INTEGER NOT NULL,
    NAME VARCHAR(10),
    SSNUM INTEGER,
    MGR INTEGER);
    ALTER TABLE PERSON ADD CONSTRAINT PK_PERSON PRIMARY KEY (PK);
    ALTER TABLE PERSON ADD CONSTRAINT FK_PERSON FOREIGN KEY (MGR) REFERENCES
    PERSON (PK);
    /* Tables
    CREATE TABLE PROJECT (
    PK INTEGER NOT NULL,
    CODE_NAME INTEGER);
    ALTER TABLE PROJECT ADD CONSTRAINT PK_PROJECT PRIMARY KEY (PK);
    /* Tables
    CREATE TABLE XREF (
    PERSON INTEGER NOT NULL,
    PROJECT INTEGER NOT NULL);
    ALTER TABLE XREF ADD CONSTRAINT PK_XREF PRIMARY KEY (PERSON, PROJECT);
    ALTER TABLE XREF ADD CONSTRAINT FK_XREF1 FOREIGN KEY (PERSON) REFERENCES
    PERSON (PK);
    ALTER TABLE XREF ADD CONSTRAINT FK_XREF2 FOREIGN KEY (PROJECT) REFERENCES
    PROJECT (PK);
    I do like the way of "ReverseTutoral" and the file .jdo here :
    <?xml version="1.0" encoding="UTF-8"?>
    <jdo>
    <package name="reversetutorial">
    <class name="Person" objectid-class="PersonId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="PERSON"/>
    <field name="name">
    <extension vendor-name="kodo" key="data-column"
    value="NAME"/>
    </field>
    <field name="person">
    <extension vendor-name="kodo" key="pk-data-column"
    value="MGR"/>
    </field>
    <field name="persons">
    <collection element-type="Person"/>
    <extension vendor-name="kodo" key="inverse"
    value="person"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="person"/>
    </field>
    <field name="pk" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PK"/>
    </field>
    <field name="ssnum">
    <extension vendor-name="kodo" key="data-column"
    value="SSNUM"/>
    </field>
    <field name="xrefs">
    <collection element-type="Xref"/>
    <extension vendor-name="kodo" key="inverse"
    value="person"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="person"/>
    </field>
    </class>
    <class name="Project" objectid-class="ProjectId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="PROJECT"/>
    <field name="codeName">
    <extension vendor-name="kodo" key="data-column"
    value="CODE_NAME"/>
    </field>
    <field name="pk" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PK"/>
    </field>
    <field name="xrefs">
    <collection element-type="Xref"/>
    <extension vendor-name="kodo" key="inverse"
    value="project"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="project"/>
    </field>
    </class>
    <class name="Xref" objectid-class="XrefId">
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="table" value="XREF"/>
    <field name="person">
    <extension vendor-name="kodo" key="pk-data-column"
    value="PERSON"/>
    </field>
    <field name="person2" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PERSON"/>
    </field>
    <field name="project">
    <extension vendor-name="kodo" key="pk-data-column"
    value="PROJECT"/>
    </field>
    <field name="project2" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="PROJECT"/>
    </field>
    </class>
    </package>
    </jdo>
    Data of those tables are :
    PERSON :
    | PK | NAME | SSNUM | MGR |
    | 1 | ABC | 1 | 1 |
    | 2 | DEF | 5 | 1 |
    PROJECT
    | PK | CODE_NAME |
    | 1 | 12 |
    | 2 | 13 |
    And now I want to add a new record into table XREF : insert into XREF
    values (1,1);
    public void createData() {
    Xref xref = new Xref();
    Person person = new Person(1);
    Project project = new Project(1);
    xref.setPerson(person);
    xref.setProject(project);
    person.getXrefs().add(xref);
    person.getXrefs().add(xref);
    pm.currentTransaction().begin();
    pm.makePersistent(xref);
    pm.currentTransaction().commit();
    I don't know why Kodo automatically insert new record to table PERSON ->
    confilct Primary Key. The errors are :
    0 [main] INFO kodo.Runtime - Starting Kodo JDO version 2.4.1
    (kodojdo-2.4.1-20030126-1556) with capabilities: [Enterprise Edition
    Features, Standard Edition Features, Lite Edition Features, Evaluation
    License, Query Extensions, Datacache Plug-in, Statement Batching, Global
    Transactions, Developer Tools, Custom Database Dictionaries, Enterprise
    Databases, Custom ClassMappings, Custom ResultObjectProviders]
    41 [main] WARN kodo.Runtime - WARNING: Kodo JDO Evaluation expires in 29
    days. Please contact [email protected] for information on extending
    your evaluation period or purchasing a license.
    1627 [main] INFO kodo.MetaData -
    com.solarmetric.kodo.meta.JDOMetaDataParser@e28b9: parsing source:
    file:/D:/AN/Test/classes/reversetutorial/reversetutorial.jdo
    3092 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] open:
    jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
    3325 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ]
    close:
    com.solarmetric.datasource.PoolConnection@164dbd5[[requests=0;size=0;max=70;hits=0;created=0;redundant=0;overflow=0;new=0;leaked=0;unavailable=0]]
    3335 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] close
    connection
    3648 [main] INFO jdbc.JDBC - Using dictionary class
    "com.solarmetric.kodo.impl.jdbc.schema.dict.InterbaseDictionary" to
    connect to "Firebird" (version "__WI-V6.2.972 Firebird 1.0.3)WI-V6.2.972
    Firebird 1.0.3/tcp (annm)/P10") with JDBC driver "firebirdsql jca/jdbc
    resource adapter" (version "0.1")
    4032 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] open:
    jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
    4143 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    preparing statement <3098834>: INSERT INTO XREF(PERSON, PROJECT) VALUES
    4224 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    executing statement <3098834>: [reused=1;params={(int)1,(int)1}]
    4244 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    preparing statement <9090824>: INSERT INTO PERSON(MGR, NAME, PK, SSNUM)
    VALUES (?, ?, ?, ?)
    4315 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
    executing statement <9090824>: [reused=1;params={null,null,(int)1,(int)0}]
    4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
    resultSetType or resultSetConcurrency changed
    4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
    resultSetType or resultSetConcurrency changed
    4598 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] begin
    rollback
    4608 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] end
    rollback 10ms
    4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ]
    close:
    com.solarmetric.datasource.PoolConnection@1878144[[requests=2;size=2;max=70;hits=0;created=2;redundant=0;overflow=0;new=2;leaked=0;unavailable=0]]
    4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] close
    connection
    javax.jdo.JDOFatalDataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
    [PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
    GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
    on table "PERSON" [code=335544665;state=null]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
    [PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
    GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
    on table "PERSON"
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:17)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:416)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
    at reversetutorial.Finder.createData(Finder.java:74)
    at reversetutorial.Finder.main(Finder.java:141)
    NestedThrowablesStackTrace:
    org.firebirdsql.jdbc.FBSQLException: GDS Exception. violation of PRIMARY
    or UNIQUE KEY constraint "PK_PERSON" on table "PERSON"
    at
    org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:425)
    at
    org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
    at
    com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
    at reversetutorial.Finder.createData(Finder.java:74)
    at reversetutorial.Finder.main(Finder.java:141)
    at org.firebirdsql.gds.GDSException: violation of PRIMARY or UNIQUE KEY
    constraint "PK_PERSON" on table "PERSON
    at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1683)
    at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1636)
    at org.firebirdsql.jgds.GDS_Impl.isc_dsql_execute2(GDS_Impl.java:865)
    at
    org.firebirdsql.jca.FBManagedConnection.executeStatement(FBManagedConnection.java:782)
    at
    org.firebirdsql.jdbc.FBConnection.executeStatement(FBConnection.java:1072)
    at
    org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:420)
    at
    org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
    at
    com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
    at reversetutorial.Finder.createData(Finder.java:74)
    at reversetutorial.Finder.main(Finder.java:141)
    Exception in thread "main"

    First off, use the '-primaryKeyOnJoin true' flag when running the reverse
    mapping tool so that you can get rid of that useless Xref class and have
    a direct relation between Person and Project. See the documentation on
    reverse mapping tool options here:
    http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_pc_reverse.html
    But your real problem is that you are creating new objects, assigning
    primary key values, and expecting them to represent existing objects.
    That's not the way JDO works. If you want to set relations to existing
    objects in JDO, you use the PM to look up those objects. If you try to
    create new objects, JDO will assume you want to insert new records into
    the DB, and you'll get PK conflicts like you see here.
    There are several good books out on JDO; if you're just starting out with
    it, they might save you a lot of time and help you master JDO quickly.

  • ADF Toplink Create Row with foreign key

    Hello,
    I'd like to create a new row in a table that has a required one-to-one mapping relationship (foreign key). I've created an edit form by dragging the return node of a readQuery. The columns holding foreign key values aren't added to the page(because of 1-1 relationship) and when I commit the changes errors are raised.
    How do I pass the foreign key to the ADF Toplink framwork to include in the insert statement.

    TopLink's persistence model is based around relationships, which represent FKs. To have these FKs properly populated you need to create the corresponding object relationships.
    To do this you need to create a data action that will invoke a method on your class passing in the object you want to create the relationship with. There is currently an issue where ADF will not allow you to easily drop a set method onto an action. You will need to create a method on your bean that does not start with 'set'.
    In the demos I have done I have added a method like 'populateAddress(Address)' that internally calls the set method. This populate method will show up on the data control palette and you can then drop it on the action in your page flow.
    One additional tip: To access the object you want to pass in you will need to extend the default expression that reflects the current selected row in the iterator to have '.dataProvider' appended. This accesses the persistent object within row container.
    If you are still struggling please contact me through the email address in my forum profile.
    Doug

  • Problem with foreign key in entity bean in WSED..Plzzzzz help!!!!!

    hi all,
    m very new to ejb...m crerating container managed entity bean in wsed..The steps I have followed r as follows,
    i) created 2 tables in database,one is PARENT with fields ID(Primary Key) and NAME and another is CHILD with fields ID1(Foreign Key) and NAME.
    ii)created 2 entity beans... 1st is parent with fields id(key field) and name(promote getter & setter methods to local interface)...2nd is child
    (choosed parent as bean super type) with fields id1 (promote getter & setter methods to local interface) and name (promote getter & setter methods to local interface)...
    iii)Generated EJB to RDB mapping(choosed crreate new backend folder->meet in the middle->use existing connection->choosed the tables parent & child in the database->match by name->finish)
    now m getting an error in Map.mapxmi--->"The table PARENT does not have a discriminator column"...and a warning--->"A primary key does not exist for table: CHILD in file: platform:/resource/NewFK/ejbModule/META-INF/backends/DB2UDBNT_V8_1/Map.mapxmi.     Map.mapxmi     NewFK/ejbModule/META-INF/backends/DB2UDBNT_V8_1     L/NewFK/ejbModule/META-INF/backends/DB2UDBNT_V8_1/Map.mapxmi"

    Hi Sandra,
    Many thanks for your response and providing time of yours.
    Now, I have done exactly the same thing, but still it is the same.
    I have created two new tables as below:
    ZAAVREF (Check table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    ZAAV1 (Foreign key table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    Then I have created FK on country of foreign key table ZAAV1 and then SE16 (for table ZAAVREF)->Create Entries-> Entered values for Country only->Save....Records entered with valid Country values.
    After that SE16 (for table ZAAV1)->Create Entries-->Entered an Invalid country->Save->Still the record entered to the Database successfully....
    Could you please let me know where I am going wrong.
    I am using SAP R/3 4.7 and creating tables using Tools->ABAP Workbench->Development->ABAP dictionary

  • Problem creating table with foreign key in SQL Workshop

    Application Express version 2.2.1.00.04
    Get error message "Number of referencing columns/data types must match referenced columns"
    Master table SLS_SUPPLIERS has primary key SLS_ID NUMBER(8,0) and when creating table SLS_PRODUCTS with FK SLS_SLP_ID NUMBER(8,0) using the create table wizard I get the above error.
    The name of the FK is SLP_SLS_FK, key column is SLP_SLS_ID, referenced table is SLS_SUPPLIERS and referenced column is SLS_ID.
    Any help is much appreciated.
    James Edey
    I should add that if I create the table without the foreign key constraint and then create the constraint separately in SQL Workshop then it creates OK. It only fails in the create table wizard dialog.
    Message was edited by:
    edeyje
    Obviously no-one interested in this - just thought it may be a bug in v2.2 that the development team would find useful.
    James
    Message was edited by:
    edeyje

    I replied to the other thread on this too -
    there is a bug on that page when you click Next. If you define more than one fk but then navigate using the links on the process chart on the left (Constraints, Confirm, etc), the page works fine. We do have a bug on this now and I just added the notes I will need to get this fixed in 3.1 (I have already assigned it to me - must have some rogue validation that fires on next).
    Sorry it took so long for this to get noticed - I am glad I checked the forum this morning -
    -- Sharon

  • Legacy Mapping Problem: Compound PK is Foreign Key

    My job is to map beans using JPA onto a legacy database schema that must not get modified. I am stuck with doing the relation between two tables.
    The schema is:
    CREATE TABLE A (
         a1 INTEGER NOT NULL,
         a2 INTEGER NOT NULL,
         PRIMARY KEY (a1, a2)
    CREATE TABLE B (
         b1 INTEGER NOT NULL,
         b2 INTEGER NOT NULL,
         b3 INTEGER NOT NULL,
         FOREIGN KEY f (b1, b2) REFERENCES A (a1, b2) ON UPDATE CASCADE ON DELETE CASCADE,
         PRIMARY KEY (b1, b2, b3)
    )As you can see, both tables have compound primary keys, and the primary key of table B contains a foreign key to table A. This is typical in our DB because B in fact acts like a "inner table" (in the sense of "inner class") to A.
    So far I defined both classes and provided a primary key, but the question now is, how to provide the relation between both? The relation shall be unidirectional, so that I can query all Bs belonging to one A by "myA.getBs(): Collection".
    The code I have written so far is:
    @Entity
    public class A {
         @EmbeddedId
         private APK primaryKey;
         @OneToMany
         private Collection<B> characteristics;
    @Embeddable
    public class APK {
         private String a1;
         private String a2;
    @Entity
    public class B {
         @EmbeddedId
         private BPK primaryKey;
    @Embeddable
    public class BPK {
         private String b1;
         private String b2;
         private String b3;
    }Unfortunately that is not working, because the JPA Provider (here: TopLink Essentials) tries to map the relationship on a third table named "A_B" that actually is not there.
    So how to tell TopLink to find the mapping information in table B (just like using the foreign key f)?
    Please help, I am driving nuts!

    OK
    So i found out the real problem
    And the problem is that my CustomerHistory has a Text Field, as in a MS SQL Server TEXT Field
    When i changed it to a VARCHAR, it started working
    The strangest thing is that Customer also has a TEXT Field (mapped to a String) and i can do Finds without any problems
    So my question now is how can i work with TEXT in CMPs ?
    Thanks

  • Problem with Foreign Key check in an editable ALV

    Hi,
    I've implemented an editable ALV.
    The underlying context node is referenced to a structure and within the structure the foreign keys are defined.
    In my example, I have two editable columns with different foreign key checks.
    My problem is, the foreign key check works only for one column.
    So if I enter in both columns incorret values, only a message for the first column is thrown,
    but not for the second column!
    Only if I enter two errors in one(!) column (in two rows), than I get two error messages.
    Examples:
    does not work:
    COL1 | COL2
    err1  | err2   -> only one error message is displayed (for err1)
    It works in this case:
    COL1 | COL2
    err1  |  ok
    err2  |  ok
    => two messages for err1 and err2
    and in this case
    COL1 | COL2
    err1  |  ok
    ok     |  err2
    => two messages for err1 and err2
    I've found nothing in OSS. My system is a 7.00 with SP18, so OSS 1153492 is already implemented.
    Do I somenthing wrong or is this an error in SAP?
    Thanks,
    Andreas

    Hi Lekha,
    thank you very much for your support!
    I try to give you an example.
    In general, you need an editable ALV with at least two columns.
    The node for the ALV table in the component controller has to be assigned to a dictionary structure!
    That is very important, otherwise the foreign key check will not work!
    And the two fields in this dictionary structure have to be assigned to a "check table".
    Prerequisition: NW70 SP16 or higher! See oss note 1153492.
    Maybe an easy way to reproduce it is using the WD component WDT_FLIGHTLIST_EDIT.
    So copy this component to a Z-component.
    Than create a dictionary structure for the node "NODE_FLIGHTTAB" with the same 10 fields as the node attributes.
    In your new dictionary structure, assign to the fields CARRID and CONNID the check tables SCARR and SPFLI. (see table SFLIGHT).
    Than make both columens (CARRID and CONNID) editable.
    This has to be done in the "RESULTVIEW" in the method "INIT".
    You can user the following code:
      lr_column = lr_column_settings->get_column( 'CARRID' ).
      create object lr_input_field
        exporting
          value_fieldname = 'CARRID'.
      lr_column->set_cell_editor( lr_input_field ). 
      lr_column = lr_column_settings->get_column( 'CONNID' ).
      create object lr_input_field
        exporting
          value_fieldname = 'CONNID'.
      lr_column->set_cell_editor( lr_input_field ).
    Copy this code below this code:
      lr_column_settings ?= l_value.
      lr_column = lr_column_settings->get_column( 'PRICE' ).
      create object lr_input_field
        exporting
          value_fieldname = 'PRICE'.
      lr_column->set_cell_editor( lr_input_field ).
    Than just activate all,  create a Web Dynpro Application and your are ready to test it.
    To test it, do the following:
    Append/Insert an empty row.
    Enter a CARRID and CONNID that does not exist and press ENTER.
    My result: only one error message is displayed for the wrong CARRID, but no error message for CONNID!
    Insert a new row.
    Enter in the first row, column CARRID an invalid value and in the second(!) row in column CONNNID.
    Than you get two(!) error messages. That's the behavior I expect.
    So thank you very much in advance for your help!
    Regards,
    Andreas

  • Problem with Foreign Key relationships in SAP R/3 4.7

    Hi Experts,
    I am trying to create a foreign key relationship between 2 transparent tables in SAP R/3 4.7
    Table 1:ZAAVNDR (MANDT (pk), VENDORNO (pk), NAME, REGION, COUNTRY (fk)) Foreign Key Table
    Table 2: ZAAVNDRREF(MANDT(pk), COUNTRY (pk)) ---Check table
    I have added few valid countries in check table but when I am adding some records in foreign key table with invalid countries these records are not being restricted and are still successfully going into the table.
    Could any one please help in this.
    Thanks in anticipation.
    -Amit

    Hi Sandra,
    Many thanks for your response and providing time of yours.
    Now, I have done exactly the same thing, but still it is the same.
    I have created two new tables as below:
    ZAAVREF (Check table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    ZAAV1 (Foreign key table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    Then I have created FK on country of foreign key table ZAAV1 and then SE16 (for table ZAAVREF)->Create Entries-> Entered values for Country only->Save....Records entered with valid Country values.
    After that SE16 (for table ZAAV1)->Create Entries-->Entered an Invalid country->Save->Still the record entered to the Database successfully....
    Could you please let me know where I am going wrong.
    I am using SAP R/3 4.7 and creating tables using Tools->ABAP Workbench->Development->ABAP dictionary

  • Can we associate index with foreign key?

    hello
    i have searched and could not find the answer to the above;
    i have a foreign key constraint on the tables; i added an index on that column as well;
    however when i query the all_constraints, under index_name for this foreign constraint there is nothing; only when i have PK/UK i case see indexes associated with them;
    will then oracle still associate my index with the FK constrained column? or i need to excplicity associate it with the foreign key column? if so, how to do that?
    thx
    rgds

    Hi,
    UserMB wrote:
    i have a foreign key constraint on the tables; i added an index on that column as well;It helps if you give a specific example, such as:
    "I have a foreign key constraint, where emp.deptno references dept.deptno. (Deptno is the primary key of dept.) I created an index called emp_deptno_idx on emp.deptno as well."
    however when i query the all_constraints, under index_name for this foreign constraint there is nothing; only when i have PK/UK i case see indexes associated with them;Not all indexes are associated with a constraint. In the example above, you wouldn't expect to see anything about the index emp_demptno_idx in all_constraints or in all_cons_columns.
    will then oracle still associate my index with the FK constrained column? or i need to excplicity associate it with the foreign key column? if so, how to do that?In the situation above, Oracle will still use the index when the optimizer thinks it will help. You don't have to do anything else.

  • How oracle locks child table with foreign keys?

    I have 3 tables. tab1 , tab2,tab3.
    tab2 has FK on tab1.
    tab3 has FK on tab2.All the FKs are indexed.
    One transaction in my code changes tab3.
    One transaction in my code changes tab1,tab2 and tab3.
    I am facing deadlock issues on tab3 when both transactions work concurrently.
    If I lock tab1 with "for update nowait " at the start of both transaction,will the problem be solved?

    Let me elaborate on my problem
    TAB1          
    =====          
    a1 b1 c1     
    a2 b2 c2     
    a3 b3 c3     
    TAB2               
    =====               
    x1 y1 z1 a1          
    x2 y2 z2 a2          
    x3 y3 z3 a3          
    (FK indexed)          
    TAB3
    =====
    p1 q1 r1 y1
    p2 q2 r2 y2
    p3 q3 r3 y3
    (FK indexed)
    Transaction 1 for session1
    select * from TAB1 where col1 = a1 for update nowait;
    doing activities on tab2 and tab3 depending on the foreign key joins in loop.
    Transaction 2 for session 2
    select * from TAB1 where col1 = a2 for update nowait;
    doing activities on tab2 and tab3 depending on the foreign key joins in loop.
    1) Please let me know whether these sessions can head towards deadlock.
    2) If some session try to update TAB3 row of y1 when session 1 is still working , how will system behave?
    will it go for blocked session or go for dead lock or get an exception message?
    Edited by: user9974355 on Dec 17, 2008 11:58 PM
    Edited by: user9974355 on Dec 18, 2008 12:00 AM

  • Retrieving foreign key data

    I have a table called Requirements that has a column called status_id. Status_id is a foreign key to another table called Status. I have created a BC4J project and I am using uixml. I chose the Complete uixml application option to create my pages. It created a search page for Requirements but when it displays the records it displays the status id and I would like it to display the correct status description from my status table. How do I incorporate this into my uixml page?
    I am very new to BC4J.

    I found the answer:
    Create a view object that includes "Requirements" EO and "Status" EO, with "Status" participating in "Read-Only", "Reference" mode.
    However, in doing so I found another problem. When I make changes to my application module, my uiXML pages do not see those changes until I close JDev completely and then reopen. I have tried to rebuild both projects (my BC4J components are in one and my uiXML pages in another). I have tried to rebuild the workspace as well as the page I want to see the change in. When I test the module (right click on module and select test) I see the changes but my pages still do not.
    Any ideas???

Maybe you are looking for

  • SCCM 2012 : Deploying System Center Configuration Manager 2012, Required Desinging Help.

    Hi, I required some one to help designing an SCCM 2012 Solution. I dont have any knowledge on Design Part,  This is my first deployment My goal: Interconnect 3 remote offices and  The infrastructure is as follows:  Primary Site Server ( HQ )    : 100

  • URL to pipeline session

    I have a quick question. I am writing a design of a system which will need to populate the pipeline session state directly from a URL. i.e. A user will click on a URL that they have received in an email . The URL will have a unique reference in it wh

  • External Service data

    Dear Friends, I am in the process of preparing a report which contains all the details pertaining to a workorder . It is just an ALV form of document flow for a maintenance order . I don't know how to retrieve the service related data from the table

  • Error release to R3

    From a weekly view we release the fcst to r3 and SNP in daily buckets.  It’s getting release correctly to SNP but not to R3.  The data in R3 is off setted by a day.  We don’t have any user exits in CIF.  I don’t see any problem in publication setting

  • Why is my Macbook pro clock running negative numbers?

    My Macbook Pro clock is running negative numbers.