1:M Relationship - No Foreign Key is set

Hello,
I got a problem with 1:M relationships. The data I send is inserted without problems but the foreign key column is never set (null). Its very strange cause the reading works fine.
The Structur: got 2 tables ... Parent_tab and Child_tab.
I got 3 classes ... Parent_class (this one holds an ArrayOfChild_class), Child_class and ArrayOfChild_class (That holds a Collection of Child_classes). (I know its weird but i dont made this stuff, just have to work with it (and live with it)).
So i mapped the Parent_class to Parent_tab and Child_class to Class_tab (nothing unusale there) and made the ArrayOf Class to an aggregate and put it in the parent_class (where it belongs). In the ArrayOf Aggregate I mapped the Child_class 1:M. There I also set the Foreign Key (in this case 1:1 Child to Parent).
So, anyone still there or all lost :-)
Like I said... the reading works fine, but if i try to insert data it didnt set the foreign key. Tried alot but nothin worked.
Hope someone has an idea ...
btw. I am working with Toplink 9.0.3 Build 425.

Hello,
I got a problem with 1:M relationships. The data I
send is inserted without problems but the foreign key
column is never set (null). Its very strange cause
the reading works fine.
The Structur: got 2 tables ... Parent_tab and
Child_tab.
I got 3 classes ... Parent_class (this one holds an
ArrayOfChild_class), Child_class and
ArrayOfChild_class (That holds a Collection of
Child_classes). (I know its weird but i dont made
this stuff, just have to work with it (and live with
it)).
So i mapped the Parent_class to Parent_tab and
Child_class to Class_tab (nothing unusale there) and
made the ArrayOf Class to an aggregate and put it in
the parent_class (where it belongs). In the ArrayOf
Aggregate I mapped the Child_class 1:M. There I also
set the Foreign Key (in this case 1:1 Child to
Parent).
So, anyone still there or all lost :-)
Like I said... the reading works fine, but if i try
to insert data it didnt set the foreign key. Tried
alot but nothin worked.
Hope someone has an idea ...
btw. I am working with Toplink 9.0.3 Build 425.I think this post is relevant to your situation. Please confirm if you are getting the same error.
Master-Detail Insertion problem

Similar Messages

  • Foreign Key Constraint Failure on Self-Referencing Table

    In a recent data deletion project, I ran into a problem where Oracle allowed for a record (the parent) to be deleted when there still existed a child record in the same table which referred to the parent.
    An abbreviated version of the table is as follows:
    create table test (
    template_id number not null,
    customer_id number null,
    parent_id number null,
    constraint pk_test primary key (template_id),
    constraint r_parent foreign key (parent_id) references test (template_id));
    The parent and child records are as follows:
    Parent: template_id = 100, customer_id = 200, parent_id = null
    Child: template_id = 101, customer_id = null, parent_id = 100
    Records were deleted from this table using:
    DELETE FROM test WHERE customer_id = 200;
    When this statement is executed, is it being executed as part of 155 delete statements using PL/SQL, and tens of thousands of records from 155 tables are being deleted. These delete statements have been ordered taking into account foreign key constraints. All 155 statements are being deleted in a single transaction. The delete statement above was the 23rd statement of the set to be executed. I would have expected when this delete statement was executed, an error would have been thrown. However, all 155 delete statements successfully complete, and after committing the results, the child record above still exists in the DB as an orphan. I also tried executing the first 23 statements manually in SQL*Plus (still one transaction), and the problem still occurs: the parent is deleted and the child is orphaned.
    If I execute the very simple example above, I do indeed get an referential constraint error.
    Has anyone ever encountered this situation? And does anyone have any ideas how to go about troubleshooting this problem. We need to know the cause of this, as we have a small handful of table with a similar self-referential foreign key constraint set-up.
    Thank you very much in advance,
    Mark

    First of all, the very simple example that I outlined above I have already tried and it worked: when I attempted to delete the parent a referential integrity error was thrown as one would expect. This small example was my test case to see if I could reproduce what I'm seeing in our application in a more manageable and demonstrable example. But as it worked, I'm still perplexed in reconciling the differences between what I'm seeing in our application (which I can't demonstrate in this help group) and the test case. When I used the test case in my first posting in this thread, I used it to help describe the problem I'm encountered, even though that small example works.
    Below is more of the table you've asked for.
    OWNER           CONSTRAINT_NAME          CONSTRAINT_TYPE     TABLE_NAME     SEARCH_CONDITION     R_OWNER            R_CONSTRAINT_NAME     DELETE_RULE     STATUS          DEFERRABLE            DEFERRED         VALIDATED     GENERATED     BAD     RELY     LAST_CHANGE           INDEX_OWNER  INDEX_NAME       INVALID     VIEW_RELATED
    "DOCPADMIN"     "R_TEMPLATE_PARENT"     "R"             "DCR_TEMPLATE"      (null)                  "DOCPADMIN"     "XPKDCR_TEMPLATE"     "NO ACTION"  "ENABLED"   "NOT DEFERRABLE"    "IMMEDIATE"  "VALIDATED"      "USER NAME"     (null)     (null)     "2010-01-13 19:01:21"     (null)        (null)         (null)       (null)
    "DOCPADMIN"     "XPKDCR_TEMPLATE"       "P"             "DCR_TEMPLATE"      (null)                       (null)     (null)                      (null)          "ENABLED"     "NOT DEFERRABLE"    "IMMEDIATE"      "VALIDATED"     "USER NAME"     (null)     (null)     "2010-01-13 15:48:31"     (null)     "XPKDCR_TEMPLATE"   (null)     (null)Overall, I haven't said that Oracle's FK mechanism is broken. What I've said is that I've got a situation that I'm trying to understand. My first attempt at my test case didn't work because the test case worked as it should. I'm trying to figure out another course of action to try and figure this situation out.

  • SQL data modeller -- how to create 1 to 1 relationship foreign key ?

    hi guys...
    i got 2 tables..
    table 1 - CFR
    CFR_ID = primary key
    table 2 - USER_PLAN
    USER_ID = primary key
    PLAN_ID,
    CFR_ID = foreign key reference (table 1)
    The business flows go like this..
    insdie CFR table, it contain all records / transactions of a particular user/plan. everytime a new transaction occurs for a plan/user, a new CFR_ID / row will be generated.
    after which, the newly generated CFR_ID for the new row , will be updated to the CFR_ID in USER_PLAN
    Thus, there is always a 1 to 1 relationship between the 2 table regardless how many CFR_ID is generated for a particular USER_PLAN. as the CFR_ID in the USEr_plan table will always be the latest one generated inside the CFR table.
    However, in the data modeller, i am unable to create such foreign key relationship... ANY idea how do i create a 1 on 1 foreign key relationship ? or there is no such way..
    Thanks and Best Regards,
    Noob

    Hi philips,
    Thanks for the wonderful reply..
    Just to double comfirm with you,
    even if i had set a unique constraint on CFR_ID(foreign key column), inside the relationship model, the relationship between the foreign key is still showing as a 1:m relationship right ?
    just that a character 'U' will appear beside the CFR_ID column.
    However the diagraphm is still showing a 1:M relationship.
    is this correct ?
    Regards,
    Noob

  • Composite Foreign Key Relationships

    I'm having problems defining relationships that are using the same set of fields in a composite primary key and a composite foreign key. Are there any examples for doing this kind of thing. I think I have the primary keys set up correctly but the foreign key defs aren't working yet. From the spec it looks ike it should be something like this:
    @ManyToOne
         @PrimaryKeyJoinColumns({
         @PrimaryKeyJoinColumn(name="CGMTI_ID"),
         @PrimaryKeyJoinColumn(name="MISSION_REF_DATE")})
         CgmtiHeader cgmtiHeader;
    Also, the composite foreign keys seem to make Dali's entity generation blow up.

    This mapping is missing the referencedcolumn definition, and because it is a composite pk, it cannot figure out a default value. So it should similar to:
    @ManyToOne
    @PrimaryKeyJoinColumns({
    @PrimaryKeyJoinColumn(name="CGMTI_ID", referencedColumnName="CGMTI_ID),
    @PrimaryKeyJoinColumn(name="MISSION_REF_DATE", referencedColumnName="MISSION_REF_DATE)})
    CgmtiHeader cgmtiHeader;
    Similar discussions exist in threads:
    Extra Columns in ManyToMany table workaround
    and
    http://forums.java.net/jive/thread.jspa?threadID=2564&messageID=36441
    both of which list blogs showing examples.
    Best Regards,
    Chris

  • Setting foreign keys directly

    I've discovered that Kodo (2.4.2) does not like it when I set foreign keys
    directly in order to define a relationship. If I set the foreign key and
    then call the relationship getter, even in a subsequent transaction, null
    is returned. Is this something that is prohibited by the JDO spec, a bug
    in Kodo, or something else?

    Just use the execute SQL query VI (I believe it's in the advanced palette) and feed it the table creation SQL code you already have.
    Try to take over the world!

  • 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

  • Foreign Key Relationships to external associations - Is it really this dodgy or is there a better way?

    Hi All,
    Let's picture that I have a GW service called Search Helps and within that service I have a PersonalAreas Entity Set which acts as a search help for drop down fields effectively that need to select a Personal Area.  I have 3 properties, with Personal Area Id and Company Code being the keys, and the text for Personal Area being the 3rd and last property. You really need to filter PersonalAreas by Company Code otherwise it's a fairly useless result set.
    Now within a different GW service, I have an entity called Position which has a single key of PositionId.  There is also a a property of company code on this Position.
    Now rather than asking the UI developer to get the Company code value and filter PersonalAreas with it directly, I thought it would be nicer for the UI developer just to use the navigation from a specific Position to PossiblePersonalAreas.  e.g. Positions('123')/PossiblePersonalAreas returns the entity set of PersonalAreas filtered by the Position's Company Code.
    So with that in mind, I add the external model reference pointing at the search helps service; then create an external association via the sneaky External Associations Editor button (that doesn't appear on the Wizard just to confuse you), and set up my Dependent entity to point at the Search Helps PersonalAreas entity.
    At this point I really want to tie the Position's Company Code to the PersonalAreas Company Code, but all I can do is set up a referential constraint of PositionId to CompanyCode or have no referential constraint at all (note - in my example I added the referential constraint as there is an issue with navigation keys being provided to external associations from what I can tell - more about this below).
    So, without any other option, I go into my GetEntitySet method of PersonalAreas and write something like the following:
      CASE iv_source_name.
        WHEN 'Position'.
          READ TABLE it_filter_select_options ASSIGNING <filter> INDEX 1.
          CHECK sy-subrc = 0.
          READ TABLE <filter>-select_options assigning <select_option> INDEX 1.
          CHECK sy-subrc = 0.
          position_id = <select_option>-low.
    *     Get company code for position
          TRY.
              CREATE OBJECT o_position
                EXPORTING
                  i_position_id = position_id.
              o_position->get_cost_centre_information(
                IMPORTING
                  e_company_code = company_code
            CATCH zcx_hr_object.
          ENDTRY.
      endcase.
    * Continue with retrieving PersonalAreas for given Company Code
    <Remaining code not shown>
    e.g. I have to assume CompanyCode is actually "Position Id" when the source of this call is from Position (I could also look at the navigation to find this has come from Position but if you're wondering, unfortunately for external associations, the key is not included in this for some reason but the same followup logic of reloading the object would be required).
    So the question I'm hoping the answer to is Yes is: Am I missing something in my understanding here?
    Thanks,
    Matt
    Edit since posting and playing around a bit more: Thinking about this further - it's unfortunate, but the navigation property in odata really implies the dependent entity has knowledge of the principal entity and realistically must know how to instantiate it if it needs to get data based on one of the properties. 
    Now while I'm fine with that (sort of) I think it's wrong that the dependent entity needs to have the required key properties to hold the principal entities as it makes something like a generic search help impossible to do with navigation - Maybe I just need to be done with that and expect filters to be used by UI programmers to find foreign key'ed entities....

    Hi Matt,
    I'm not surprised that you have an issue with this. One bugbear I have with Gateway is that for some reason the designers don't think any context beyond the immediate preceding navigation node is important. They don't support this within the same service,so it's hardly likley to work in a service reference.
    I may be wrong but I don't think GW is OData compliant in this respect. If I have the navigation path /blindservice/FromHereSet(1)/ToAPoints(22)/ToBPoints, it's rather restrictive to say I cannot see the initial key of '1' in the path when I am trying to resolve 'ToBPoints'. If that value - where I started - is key to the context, I have to know it.
    Currently the only way to access this context is to embed the 'key history' in the intermediate entities, i.e. /blindservice/FromHereSet(1)/ToAPoints(1,22)/ToBPoints. In my view that is corrupting the URl to suit the limitations of the SAP OData implementation. What's even more confusing/frustrating is that the technical request context appears to be able to store the stacked navigation keys but doesn't make use of this design. 
    I feel your pain
    Ron.

  • 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.

  • 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

  • Mapping in OWB with primary key and foreign key relationship

    Hi all,
    I am new to this datawarehousing field. I have just started my career. I have to now create a mapping in owb where a table has a field which is a primary key of another table in the same staging area. If you guys could help me out with the a method it can be created that would be very helpful to me.
    I thought of 2 ideas,
    1. If I can use a look up, but then I am not sure if i can use a lookup for primary key, foreign key relationship. If I can use also, I do not know how to use that.
    2. What if I can directly take that the first table and link the primary key of that table to the second table which uses that primary key of the first table as one of its fields.
    I do not know how feasible these methods are. Please guys help me out.
    Thanks in advance.

    I have a similar case where table a and table b having relation but table a got inserted with data and table b is empty so there no values for foriegn key column in table b to realte with table a.
    Now i want to load table b foriegn key with primary key column values of table a.
    how can we do this in owb
    thanks
    kumar

  • Code generation - foreign key relationships

    I'm using the code/descriptor generation tab to generate classes from existing tables. It offers an option of choosing which relationships to generate, but seems to miss out some of the defined foreign key relationships in the database.
    I have three tables, CLIENTS, TXNS and REG
    The following constraints are defined in my database:
    TXN Primary Key: (TXN_ID)
    CLIENTS Primary Key :CLIENT_ID, TXN_ID)
    CLIENTS Foriegn KEy : TXN_ID references TXNS
    REG Primary Key: CLIENT_ID, TXN_ID
    REG Foreign Key: CLIENT_ID, TXN_ID references CLIENTS
    I select these three tables and choose generate classes and descriptors for selected tables. When the "Choose Relationships to generate" screen comes up, it only shows me the CLIENTS<-->TXNS relationship, but not the REG<-->CLIENTS relationship, even though the database foreign key constraints all look as though they've been defined in similar ways.
    thanks for any help.

    Hi Matt,
    I'm not surprised that you have an issue with this. One bugbear I have with Gateway is that for some reason the designers don't think any context beyond the immediate preceding navigation node is important. They don't support this within the same service,so it's hardly likley to work in a service reference.
    I may be wrong but I don't think GW is OData compliant in this respect. If I have the navigation path /blindservice/FromHereSet(1)/ToAPoints(22)/ToBPoints, it's rather restrictive to say I cannot see the initial key of '1' in the path when I am trying to resolve 'ToBPoints'. If that value - where I started - is key to the context, I have to know it.
    Currently the only way to access this context is to embed the 'key history' in the intermediate entities, i.e. /blindservice/FromHereSet(1)/ToAPoints(1,22)/ToBPoints. In my view that is corrupting the URl to suit the limitations of the SAP OData implementation. What's even more confusing/frustrating is that the technical request context appears to be able to store the stacked navigation keys but doesn't make use of this design. 
    I feel your pain
    Ron.

  • Query Builder - foreign key relationships not showing automatically

    Is it standard functionality in APEX that foreign key to primary key relationships are not shown in Query Builder when choosing related tables? Do you always have to join FKs to PKs manually (i.e. using control click) whenever you create joins in queries? In Oracle forms and SQL Developer the foreign key constaints are always draw in automatically. Any reason why this is not part of APEX's query builder as well? It's such a hassel to have to put them in each time when the relationships could easily be read directly from the data dictionary constraints.
    regards
    Paul P

    bump...

  • Building relationships that have no foreign key

    Hi,
    I have a situation where the database team have provided me a schema
    something like that shown below:
    PERSON
    |========================================|
    | PK | NAME | SSNUM | MGR |
    |========================================|
    | 1 | john | 123-45-6789 | 3 |
    | 2 | fred | 987-65-4321 | 3 |
    | 3 | alice | 111-22-3333 | NULL |
    | ... |
    |========================================|
    COMPANY
    |=================|
    | PK | NAME |
    |=================|
    | 1 | acme |
    | 2 | bcme |
    | 3 | ccme |
    | |
    |=================|
    ATTRIBUTE
    |========================================|
    | PK | SOURCE_ID | SOURCE_TYPE | VALUE |
    |========================================|
    | 1 | 1 | P | one |
    | 2 | 1 | C | two |
    | ... |
    |========================================|
    PERSON and COMPANY are application objects. A PERSON or a COMPANY can
    have an ATTRIBUTE tagged to it. Now, there is not a foreign key
    relationship from PERSON/COMPANY to ATTRIBUTE. The relationship can be
    derived by understanding that ATTRIBUTE.SOURCE_ID is the PK value for
    either PERSON or COMPANY, and ATTRIBUTE.SOURCE_TYPE states whether its a
    PERSON (P) or COMPANY (C).
    The database guys say this is a common approach to modelling data that
    is not a "first order" property of a class, which I guess may be up for
    debate. In any case....
    I can't model this using objects and relationships using KODO. So, my
    question is, how would you approach this?
    Thanks,
    Mike.
    PS As an aside, if there was a way in the JDO metadata to "hardcode" a
    value for one or more of the columns in a foreign key relationship, it
    would help a lot. Then I could build a navigable link from PERSON to
    ATTRIBUTE, where the SOURCE_ID data column is PERSON.PK and the
    SOURCE_TYPE is the string literal 'P'.

    That certainly is a unique problem... and certainly not a sort of model I
    would encourage...
    however, you should be able to accomplish this in Kodo with a non-direct
    relationship... i.e. Attributes has a reference-id not a reference. So
    Attribute may say look like this:
    private int referenceId = -1;
    private char type;
    public void getSource ()
    Object oid = null;
    if (referenceId < 0)
         return null;
    switch (type)
    case 'P':
         oid = new PersonId (referenceId);
         break;
    case 'C':
         oid = new CompanyId (referenceId);
         break:
    default: return null;
    return JDOHelper.getPeristenceManager (this).getObjectById (oid, true);
    public void setSource (Person p)
    PersonId pid = (PersonId) JDOHelper.getObjectId (p);
    refernceId = pid.id;
    type = 'P';
    Now this would get a little more complicated for objects which
    haven't been made persistent, but can simply be accomplished by using
    javax.jdo.InstanceCallbacks and preStore () and using a transient field
    Object source. Using non-application identity, would require casting oids to
    our ObjectIds.Id (in our JavaDoc). Actually, as I think about it, it may
    be better to do this all in a transient state:
    public Attribute
         private transient Object src;
         private int referenceId;
         private char type;
         public void setSource (Person p)
              src = p;
         public Object getSource ()
              if (src != null || JDOHelper.getPersistenceManager (this) == null)
                   return src;
              /// same as previous example
              return JDOHelper.getPersistenceManager (this).getObjectById (oid);
         public void preStore () // instancecallbacks
              PersonId id = (PersonId) JDOHelkper.getObjectId (src);
              referenceId = id.id;
              type = 'P';
    Again this isn't 100% solid code but a suggestion to get you started on
    your problem.
    While 3.0 will support more complex mappings, it won't get around the
    multiple types per field problem... but this could be solved via
    interfaces (e.g. public interface AttributeSource), though I'd have to
    defer to our 3.0 architect on that one.
    On Fri, 14 Feb 2003 16:15:04 +0200, Mike Hogan wrote:
    Hi,
    I have a situation where the database team have provided me a schema
    something like that shown below:
    PERSON
    |========================================|
    | PK | NAME | SSNUM | MGR |
    |========================================|
    | 1 | john | 123-45-6789 | 3 |
    | 2 | fred | 987-65-4321 | 3 |
    | 3 | alice | 111-22-3333 | NULL |
    | ... |
    |========================================|
    COMPANY
    |=================|
    | PK | NAME |
    |=================|
    | 1 | acme |
    | 2 | bcme |
    | 3 | ccme |
    | |
    |=================|
    ATTRIBUTE
    |========================================|
    | PK | SOURCE_ID | SOURCE_TYPE | VALUE |
    |========================================|
    | 1 | 1 | P | one |
    | 2 | 1 | C | two |
    | ... |
    |========================================|
    PERSON and COMPANY are application objects. A PERSON or a COMPANY can
    have an ATTRIBUTE tagged to it. Now, there is not a foreign key
    relationship from PERSON/COMPANY to ATTRIBUTE. The relationship can be
    derived by understanding that ATTRIBUTE.SOURCE_ID is the PK value for
    either PERSON or COMPANY, and ATTRIBUTE.SOURCE_TYPE states whether its a
    PERSON (P) or COMPANY (C).
    The database guys say this is a common approach to modelling data that
    is not a "first order" property of a class, which I guess may be up for
    debate. In any case....
    I can't model this using objects and relationships using KODO. So, my
    question is, how would you approach this?
    Thanks,
    Mike.
    PS As an aside, if there was a way in the JDO metadata to "hardcode" a
    value for one or more of the columns in a foreign key relationship, it
    would help a lot. Then I could build a navigable link from PERSON to
    ATTRIBUTE, where the SOURCE_ID data column is PERSON.PK and the
    SOURCE_TYPE is the string literal 'P'.--
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Foreign key in many to one relationship causes redunency

    Hi
    suppose I have two tables
    A and B
    Table A has a primary key A_PK number
    Table B has a primary key B_PK number
    The relation between two tables is M to One
    if B_PK is foreign key on table A
    then it causes redunency
    A_PK B_PK
    1 1
    2 1
    so what the best way to solve like this problem?
    thanks

    VANPERSIE wrote:
    Hi
    suppose I have two tables
    A and B
    Table A has a primary key A_PK number
    Table B has a primary key B_PK number
    The relation between two tables is M to One
    if B_PK is foreign key on table A
    then it causes redunency
    A_PK B_PK
    1 1
    2 1
    so what the best way to solve like this problem?
    thanksIt's not sure from your description exactly how/where/what columns are involved in the FK relationship. You either have no problem, or your problem is that you have two tables with the same PK, meaning you haven't normalized your design.
    As suggested, post actual table defs, not just a vague description.

  • How to represent foreign key relationship between entity services

    Hi All,
    I have two entity services sbu and lob with remote persistensy(web service).In the sql database also i have these two tables.
    lob table attributes: lobId and lobName.
    sbu table attributes:sbuId,sbuName,and lobId.Here lobId a is foreign key referring to primary key of lob table.
    I want to represent this in the entity services.
    Can you plz tell me how can i do this?.
    Thanks
    Sampath.G

    Hi Sampath,
    to avoid creating a lob entity set the lobId and the timestamp attributes. because this is not smoothly done in the service browser, continue writing your UI.
    in old caf implementation this blog serie gives you a short overview...
    /people/raphael.vogel/blog/2006/05/18/writing-a-betting-pool-application-for-the-soccer-world-cup-2006-part-i
    /people/raphael.vogel/blog/2006/05/18/writing-a-betting-pool-application-for-the-soccer-world-cup-2006-part-ii
    /people/raphael.vogel/blog/2006/05/19/writing-a-betting-pool-application-for-the-soccer-world-cup-2006-part-iii
    /people/raphael.vogel/blog/2006/05/21/writing-a-betting-pool-application-for-the-soccer-world-cup-2006-part-iv
    Regards, Jens

Maybe you are looking for

  • Add new fields in VA45

    Friends,my requirement is to add two new fields in SAP standard program of VA45. I executed VA45 tcode then status----> system and i got program name.I also got access key but how to add 2 new fields in this program.It is a standard program and very

  • Incoming Payments Error

    Hi experts, I have a customer with version 2007 and when him try include a Incoming Payment with a payment meas Bank Transfer occurr this  erro bellow: I nvalid Code [Journal Entry - Rows - Account Code] [line:2], '999999' [Message 173-36]

  • Query in Distribution Model creation

    Hello All, we are trying to build a distribution logic based on the below criteria first data object has the following node structure DO1   node1     childnode1        -field1        -field2     childnode2        -field1        -field2 the second dat

  • Upgrade directly from 1.2 to 2.0?

    Hi, Do I need to upgrade from my current version of 1.2 to the last pre 2.0 version (1.4 or whatever it was last on) before I can upgrade to 2.0? Thanks a lot. -keith.

  • CATS transfer - Indirect Recharge

    I'm trying to make a single CATS entry that includes the fields below, in order to records cost against the cost center of the work center, and the maintenance work order (at different rates - purchased services rate, activity type rate). The fields