N:M Relation Master-Detail

Dear Jdevelopers,
I have a N:M relation and with a query this is working correctly. But how can I insert (by using a LOV) a new record in de detail? E.G. Table: EMP and Table PHONE are connected with EMP_PHONE Table.
How can I add an existing Phone Number(s) to my EMP Table?
I used to work with Oracle Forms and there I can use the table EMP_PHONE as my detail and show the fields from the PHONE by using a multi Datasource with a Join.
Is there a similar technic in Jdeveloper?
Regards,
Menk

I found a solution myself.
Instead of defining a N:M relation you define a 1:n relation with the relation table.
If you change the SQL Statement in the view object editor then you can add fields from the master table.
e.g.
SELECT TContactpersoonTTelefoon.TEL_TEL_ID,
TContactpersoonTTelefoon.CPERS_CPERS_ID,
     T_Telefoon.tel_type,
     T_Telefoon.nummer
FROM T_CONTACTPERSOON_T_TELEFOON TContactpersoonTTelefoon,
     T_TELEFOON
WHERE TContactpersoonTTelefoon.TEL_TEL_ID = T_TELEFOON.TEL_ID
I'm not sure if this is full proof (I have to test it), so if other people have experience with this please let me know

Similar Messages

  • Master details relation issue....

    Hello folks,
    I have 2 datablocks with the relation master-details, what i need for my application is when i execute a query on the master block only the records that have details appear in my query in others words i don't for user to see records in master block where these records don't have details records???? is this is possible??
    please help

    In the default where clause of the master block you add something like this:
    where exists (select 'x' from detail_table dt
                  where dt.foreign_key = primary_key)

  • Help on Master Detail relation

    Im using XSQL command line processor 1.0.2.0.
    How I can I write a SQL query To display master detil relation in the output?
    For example Department and Emp are two different tables with master detail relation...
    I just want to display the output some thing like..
    <Department>
    <Details>
    <Dep_name>Accounts</Dep_name>
    <Dep_no>10</Dep_no>
    <EMP>
    <EMP_NAME>AAAAAA</EMP_NAME>
    <EMP_NO>999999999</EMP_NO>
    <HRD>01/01/2000</HRD>
    </EMP>
    <EMP>
    <EMP_NAME>BBBBBB</EMP_NAME>
    <EMP_NO>100000000</EMP_NO>
    <HRD>01/01/2000</HRD>
    </EMP>
    </Details>
    <Details>
    <Dep_name>INVENTORY</Dep_name>
    <Dep_no>20</Dep_no>
    <EMP>
    <EMP_NAME>CCCCCCC</EMP_NAME>
    <EMP_NO>8888888888</EMP_NO>
    <HRD>01/01/2000</HRD>
    </EMP>
    <EMP>
    <EMP_NAME>BBBBBB</EMP_NAME>
    <EMP_NO>100000000</EMP_NO>
    <HRD>01/01/2000</HRD>
    </EMP>
    </Details>
    </Department>

    [list]
    [*]First, I'd recommend upgrading to XSQL 1.0.4.3, the latest production release that is part of the XDK for Java 8.1.7.1 at http://otn.oracle.com/tech/xml
    [*]Then, explore using the Oracle CURSOR() expression to create nested rowsets. This is documented in our SQL language reference info here on OTN. My book has several examples of using CURSOR() to produce master/detail results, too.
    [list]
    Steve Muench
    Development Lead, Oracle XSQL Pages Framework
    Lead Product Manager for BC4J and Lead XML Evangelist, Oracle Corp
    Author, Building Oracle XML Applications
    null

  • Creating a new row in a master detail VO relation and its consequences.

    Hi,
    I'm currently facing a lot of problems which make me doubt if my perception about the whole ADF entity-view object mechanism is right.
    I have a page which displays data from a master detail VO relation (master offer - detail officeinfo). I also have a small dialog LOV window which makes it possible for me to select an office to match up with the current offer... Both the office LOV and the officeInfo detail use the same Office entity object.
    This worked perfectly fine until I wanted to add create NEW offers. I created my own insert method which basically performs a createRow on the master VO and inserts the newly created row in this VO. On a sidenote, I also fill out some default data read from a property file, which is why I decided to implement my own insert method in the first place.
    Initially, the problem was that the inputText fields of the detail VO (OfficeInfo) were not displayed at all. I imagined that I also had to perform the create and insert methods on the detail VO and indeed, from that point on all inputText fields were displayed and my page was ready for input.
    Yet today, I notice that in my Office LOV which is based on the same entity as the one my detail OfficeInfo VO uses, this newly created row is ALSO visible. To me this is quite unwanted and surprising behavior. I did not expect the row already to be visible in the LOV, since basically it's just an empty row ready for input...
    Am I perceiving things wrong? Or anyone has a nice solution to fix this?
    Thanks,
    Douglas

    Hi Douglas,
    It is happening because you have created an updateable office LOV which is based on same entity object used to save your newly created records.
    Use readonly LOV based on plsql query in your page and you can keep rest of the thing as it is.
    I think it will solve your problem.
    Cheers,
    Suyog

  • Multiple Master Detail Relation In Forms 6i

    I have tables as below
    1.Bill_Head
    Bill_No
    Bill_Date
    Fin_Year_Cd
    Remarks
    2.Bill_Tail
    Bill_No
    Product_Cd
    Amount
    Ded_Amount
    Net_Amount
    3.Bill_Tail_Det
    Bill_No
    Product_Cd
    Quantity
    Rate
    Interest_Percent
    Service_Charge
    Vat_Tax_Percent
    The Relation is like
    Between BILL_HEAD and BILL_TAIL is Master Details Relation
    Between BILL_TAIL and BILL_TAIL_DET is one to one relation
    In single form i am not able to insert record.
    If i build Master details between BILL_HEAD and BILL_TAIL, BILL_TAIL and BILL_TAIL_DET, when i run the for to insert data.
    I will put the data for BILL_HEAD data
    For this parent record there will be child record in BILL_TAIL block.
    For this BILL_TAIL parent record there may be a child record in BILL_TAIL_DET or may not. Suppose i put a child in BILL_TAIL_DET.
    Then i wanted put one more child record in BILL_TAIL block, if i say next record, it is asking me to "save the record first".
    Please help me in this regards
    my mail id : [email protected]
    Regards
    Mahaveer
    Message was edited by:
    user603318

    Thanks Kris, for your reply.
    Is there any way out to enter all the data at once and then commit, b'cse for every record asking to commit is tedius.
    Regards
    Mahaveer

  • Serious problem with previous / next record in master-details relations

    I have master-details relations like this (if master is A) :
    A-B
    A-C and C-D
    When I move down with do_key('next_record') all values of all records in all blocks are OK. But when I move up, it doesn't work : all D block values are erased and I don't understand why ?
    Thank you for your help.
    Antoine LEFEBVRE.

    Blocks A and B are in the first canvas and blocks C et D are in the second canvas.
    On next_record action from A the B is updated, C too and D too. But on previous_record action, D is not updates.
    To display the second canvas I use a command button and into the WBP trigger there is :
    go_block(C);
    execute_query;
    to be sure to execute query, but it's null.
    What's your suggest ?
    Thank you,
    Antoine.

  • Master-Detail Relation- Detail records not displaying

    Hi All,
    I am working forms(10g) customization for an oracle applications. our requirement is to develop a new window(screen) which should display all the related child records for the master record in the main form on a button press.
    i have developed a new database block based on a vew and provided the relation with master block, and done the required customization.
    But, when i run the form, and clicked on button, it is giving an error
    FRM-40350 Query caused no records to be retrieved.below is the code that i have written on button click
    BEGIN
              IF event = 'WHEN-BUTTON-PRESSED'
              THEN
              SHOW_VIEW('XXSCP_GBL_CUST_PEGGING_CON');
              SHOW_VIEW('XXSCP_GBL_CUST_PEGGING_STK');
              app_window.set_window_position('XXSCP_GBL_CUST_PEGGING_WIN',
                                             'CASCADE',
                                             'XXSCP_GBL_EXCEP_DETAILS_WIN');
          SET_BLOCK_PROPERTY('XXSCP_GBL_EXP_DETAIL_V',NEXT_NAVIGATION_BLOCK,'XXSCP_GBL_CUST_PEG_V');                                        
          GO_BLOCK('XXSCP_GBL_CUST_PEG_V');
         -- fnd_message.DEBUG('before execute');
          EXECUTE_QUERY;
          :parameter.p_excep_detail := 'FALSE';
              ELSE
                   NULL;
              END IF;
              EXCEPTION
                   WHEN OTHERS
                   THEN
                   fnd_message.DEBUG('other error at button press'||SQLERRM);
              --     NULL;
    END;I am able to query records in my view from database, but not working when i run the form.
    ANy suggestion will be helpful.
    Thanks in advance,
    pavan

    Duplicate post -- Re: Master-Detail Relation- Detail records not displaying

  • Master Detail Relation

    Can I design Master detail using one block for master and display like 5 records and each of this has 10 detail records. I am not sure if I can achieve this.
    Other scenario is have one master block(5 records) and have 5 detail blocks. Please give any information related

    Husna,
    1. To only show 5 reords in teh master block, just set the display record property to 5 (records displayed). Selecting one of teh master records queries the detail records (as many as there are available)
    2. Master/Detail navigation works only for the current selected master record. i get th eimpression that you want to show all detail records that belong to the five master records currently visible. If this is the case then I would'nt use a master-detail relation in Forms, but read the PK from the block record and set it as the where clause to one of the detail blocks.
    Frank

  • Master detail relation in the ADF Jdev10g sample application

    Hi,
    I have to develop Master detail relation in the ADF Jdev10g. Need sample application...Can anybody help me..

    Lots and lots of tutorials [url http://www.oracle.com/technetwork/developer-tools/jdev/overview/index-100269.html]here
    Note: 11g has been out for some time now, and if you are doing new development, it really makes sense to be using the latest software. If, by chance, you happen to be talking about doing development for the E-Business Suite, you want to be asking on the OA Framework forum.
    John

  • Master/Details Form -- Relation Property

    Is it possible to set the relation join condition property for a master/detail form programmatically. If so, what is the syntax?
    Thanks,
    Paul Howard
    [email protected]

    Use this built in
    SET_RELATION_PROPERTY
    (relation_name VARCHAR2,
    property NUMBER,
    value NUMBER);
    for more detail check from the help topics. Thanks for the info but the property I want to set isn't a listed property for that built-in. I need to change the actual join statement in the relation object. This is what I'm attempting to accomplish.
    I have a master-detail form with the master block containing 1 field (mfg_date)/ detail block containing order information(multiple records). This form allows me to step thru my orders by mfg_date. I need to be able to also step thru these orders by due_date if the operator chooses with a radio button. If I change the query_data_name and the the actual join statement in the relation object from the object navigator and compile and run it works fine. I can change the query_data_name programmatically but I can't find any info on changing the join statement programatically. Or is there another way to change the master block within the same form some other way?
    Thanks for any pointers!
    Paul Howard
    [email protected]

  • Creating a master-detail relation between a view and a table

    Hi all,
    I have a problem with creating a master-detail relation between a database-view with lots of customer data and a small table with per customer a list of entities of our companies who may work for that customer.
    Somehow I seem to be unable to create a relation between these two. I can't find where I can make a foreign key using Toplink to implement the relationship. And neither can I get a Viewlink object doing the job using ADF Business Components.
    Somebody any suggestions on this problems?
    Regards,
    Birgit

    There is a key relationship between two fields which form the primary key in the main table of the view and two fields in the second table.
    I created a viewlink manually, but I still couldn't get the data correct i.e. a form with one record of a customer from the main view and a small table with all entities of our company who can make performances for that customer.
    I tried to find a manual or a how-to on this topic but I didn't find anything helpfull yet.
    Regards,
    Birgit
    After a couple more tries, I got the master-detail working. With all the fiddling I am not sure what caused the problem but I think the finally action was checking which fields of the view were marked as primary keys.
    Now everthing is up and running.
    Birgit
    Message was edited by:
    user492355

  • Populate PK(DBSequence) in three related tables with master detail association

    Hi
    I use jdeveloper 11.1.1.6.0.
    My English isn't very good.
    I have 3 tables with master detail association between them and primary key from table A should populate to tables B and finally C .The primary key is a sequence from data base and I set PK attribute in table A as a DBSequence. (table C is the child of table B  and table B is the child of table A)
    My association is like this: A->B(BAFk1Assoc) and B ->C(CBFk1Assoc)  and also I select Composition Association for these two association. And I select ‘Cascade Update Key Attribute’
    When I insert row in these three related tables, a negative number create but when I COMMIT the PK populate only to table B not to table C and the exception below raises:
    Constraint "C_B_FK1" is violated during post operation "Insert"
    ORA-02291: integrity constraint (HR.C_B_FK1) violated - parent key not found.
    If I only work with tables A and B, there isn't any problem but if I add table C as the child of B, this exception raises.
    Habib

    The question is how you create the row for table C. Do you create it as child from table b (using the VO for B and using the link to C)?
    In this case the framework should populate the PK of the master row B as FK in table C.
    You may need to control the order in which the rows are posted to the DB to avoid this problem. Read Advanced Entity Object Techniques - 11g Release 1 (11.1.1.6.0) to get more info about this.
    However, sometimes it's easier to control the generation and setting if the PK attributes in the model layer, not relating on db triggers where you get the real values only after the commit operation is done in the db. For this you can use a Groovy expression so you have access to the PK of each new created row right after creation. Read Using Groovy Expression to set a Primary Key with a Sequence Number | JDev &amp;amp; ADF Goodies to find out how to do this.
    Timo

  • How to create 1-1 relation in Master Detail link?

    How to create 1-1 relation in Master Detail link?
    I've attached the screen shot in the link below (a Microsoft powerpoint file)
    http://us.f1f.yahoofs.com/bc/6a8130cf/bc/My+Documents/dataerror.ppt?bf2WKfABbW_fzjVn

    Hi,
    I can't reach the file at the link you gave (bcvrf.yahoo.com not found) so I can't tell quite what you're trying to do. Can you provide a bit more detail? Are you using the ER modeler or the schema diagram? If you're modeling tables in the schema diagram then the answer is you can't - there must be a foreign key at one end and that is always represented as a 'many'. To enforce a 1:1 relationship you must add code (probably in the server), for example, db triggers.
    I hope this is helpful,
    Keith.

  • Master-Details Relation

    Hi All,
    I Have one dought,I have a form with master-detail relation.
    If i query in header level i can able to see all the data in both levels.
    If i query in detail level i cannot see header level information,but i can able to see the detail level only.
    Can any help me in this
    Regards
    Siva

    Remove join condition and relation as well! In master block you should have in where close "database_item = :bl_2.item" and in detail block you should have where close with "database_item = :bl_1.item". When user put the cursor in bl_1 and execute query the bl_2 should be listed as well. You can do this on different way for ex.: write in key-exeqry or when-new-record-instance etc. on bl_1 go_block('bl_2'); execute_query; And inversely or "vice versa": when user put the cursor in bl_2 and execute query the bl_1 should be listed as well. You can do this on the same way for ex.: write in key-exeqry on bl_2 go_block('bl_1'); execute_query;
    If you want to create record you have to be carefuly on the key items in both blocks. So you have to fill the key item before user want to do the commit form. That's all but I did not test it so I can not know how could both where condition behave with different users action.

  • About master detail relation ship between tables

    Hi
    I am using jdev 11.1.1.5.0
    Use case:
    I have 2 table having master-detail relationship
    master table - req_hdr
    detail table - req_file
    req_hdr is drop as adf table (t1) on a fragment page and req_file is drop on popup as adf table (t2).
    user can add any no of row in req_file with respect to each row of req_hdr.
    to open popup for req_file, a command image link is provided in one column of req_hdr.
    On popup, there is two button provided for save and close.
    On save button,commit operation is performed and on close button,rollback operation and popup.hide() is performed.
    Now the problem what I am facing is
    1. If with respect to any row of req_hdr there is one row already exist in req_file and user click on add button to add new row in req_file and randomly user decide to to close the popup rollback operation is performed and again when user click on same row to open popup.
    Popup contains no row while in database there is one row exist for that.
    2. if user add a new row in req_file and perform save( commit ) and again for next row of req_hdr user open a popup to add new row in req_file and click on add button ,values of preceding row is already populated in new row while is should be empty because req_hdr and req_file have master detail relation and for next id of req_hdr, req_file should display new row.
    Anyone have the solution regarding this....?
    Thanks..

    the contentDelivery for the popup is already set to lazyUncached
    and on add button i use following code to add new row:--
    <code>
    Row r_file=null;
    CollectionModel tableModel = (CollectionModel)getT2().getValue();
    JUCtrlHierBinding adfModel = (JUCtrlHierBinding)tableModel.getWrappedData();
    DCIteratorBinding dciter = adfModel.getDCIteratorBinding();
    NavigatableRowIterator nav=dciter.getNavigatableRowIterator();
    r_file=nav.createRow();
    r_file.setNewRowState(Row.STATUS_INITIALIZED);
    Row lastRow=nav.last();
    int r_index=nav.getRangeIndexOf(lastRow);
    nav.insertRowAtRangeIndex(r_index+1, r_file);
    dciter.setCurrentRowWithKey(r_file.getKey().toStringFormat(true));
    r_file.setAttribute("Sno", vo_file.getEstimatedRowCount());
    r_file.setAttribute("Filetype", null);
    r_file.setAttribute("Filename", null);
    r_file.setAttribute("Remark", null);
    </code>
    There is any help regarding this....?

Maybe you are looking for

  • I'm having a problem with fractions and Mathematical Equations

    Hi I'm to write fractions in pages like I can write ¾ as a single caracter but if i need franction over ⅞ I can just write them like 1/9 I can just write as 1 divided by 9 and not as a signle character. And i would like to write fractions like 1/36 o

  • Embed pdf in website, show one page at a time, with forward and back controls?

    Hi, Not sure if this is possible (or if this is the right place to ask), but I need to take a multiple page pdf, embed it in a website so its on the left half of the screen, have it only show one page at a time, and have the forward and back page con

  • BT On line billing - web page

    It  it just  me ,     I find the BT web page  incredibly  frustrating, and  have  felt  this w ay  for  a long  time, when trying to pay your bill on line. There  is  a whole  list of  posed  questions about bills but just not  a  simple "pay your bi

  • Read a .txt file

    I'm trying to find out how to read a .txt file and simply assign its contents to a variable. Is this possible? [Edit] Right after posting I found this page which seems like it might be in the direction I want to go but I haven't checked it out comple

  • Officejet Pro 8500 A909g do not get the correct IP address from DHCP

    Hi, We reconfigured our network to use 172.16.11.xxxx We assigned the IP addresses to our OfficeJet Pro 8500 A909g printers by using DHCP reservations. After joining the wireless network, all our printers have a 169.254.xxxx.xxx address. What am I mi