Join parent with child on nested object table

We made a nested table in Oracle 8i with two object types and collection type.
We manipulating with it - no problem.
However trying to join parent with the child cause the problem in PL/SQL
This sintax is OK for Oracle SQL and returns right result:
select
matl.barcode_id,
matl.LAST_MOD_TSP,
dtl.matl_nbr,
bmm.matl_dsc,
dtl.asn_qty,
dtl.mfg_dt
from
asn_barcode_matl_ot matl,
table(matl.asn_barcode_matl_dtl) dtl,
wms_brwy_matl_mstr bmm
where
matl.rcpt_seq_id = 1
and matl.brwy_cd = bmm.brwy_cd
and dtl.matl_nbr = bmm.matl_nbr;
But stored procedure with this statement doesn't compile and giving the error:
PLS-00201: identifier 'MATL.ASN_BARCODE_MATL_DTL' must be declared
Looks like a bug? What is wrong?

It is not possible. You can do this with trigger code, or preferably by adjusting your delete procedure api. A delete of the master record will often fail because other children records exists, so you have to catch that exception and do something that is useful to you in this situation.
Regards,
Rob.

Similar Messages

  • Multiple parents with many children in same table -get all generations

    Hi
    I have parent and child columns in my table. The child can have multiple parent keys and the parent can have multiple child keys.
    So every child can be a parent of further more children. So every generation can be considered to be a level. I need to display them in hierarchical order. First greatest parent, next level all its childres, next level, their children and so on. Its like a recursve pattern. How may I achieve this? I do not know anything about how many levels there are - could be any number.
    Any help?

    Hi
    This link was of great help and I am getting the hierarchy.
    My next question related to the same thing is -
    I have the following query:
    select distinct level,
    sys_connect_by_path(child_id,'/') Path
    from table1
    connect by prior child_id= parent_id
    What I need is getting the name beloging to the id and display that instead of the id itself. But then would that mean I am changing the connect_by_path itself?
    Example:
    id
    2     /25/016
    2     /25/06
    2     /20/014
    In place of these numbers 25, 016 etc, I want their corresponding names that are stored ina nother table table2. How may I achieve that?
    Thx!

  • Group by Parent with Child Records

    Basically i have three Tables 
    Request ID   Parent ID   Account Name   Addresss 
    1452         1254789     Wendy's        Atlanta Georgia 
    1453         1254789     Wendy's        Norcross Georgia
    1456         1254789     Waffle House   Atlanta Georgia
    Bid_ID       Bid_Type    Bid_Volume   Bid_V   Bid_D  Bid_E  Request_ID  Parent ID                 
    45897        Incentive    10                 N/A     N/A       N/A     1452        1254789
    45898        Incentive    10                 N/A     N/A       N/A     1453        1254789
    45899        Incentive    10                 N/A     N/A       N/A     1456        1254789
    Bid_Number     Bid_Name    Request_ID  Parent ID
    Q789456       Wendy'Off     1452       1254789
    Q789457       Wendy'Reba    1452       1254789
    Q789456       Wendy'Off     1453       1254789
    Q789457       Wendy'Reba    1453       1254789
    Q789456       Wendy'Off     1456       1254789
    I want the Result 
    Parent ID   Bid_Type    Bid_Volume   Bid_V   Bid_D  Bid_E  AutoGeneratedCol
    1254789     Incentive    10                  N/A     N/A      N/A      1
     1254789    Incentive    10                  N/A     N/A      N/A      2
    Bid Number  AutoGeneratedCol_Link
    Q789456       1
    Q789457       1 
    Q789456       2
    Request ID  AutoGeneratedCol_Link
    1452          1
    1453          1
    1456          2
    In the above example Group parent with respect to child information .If all the Bid numbers are same (even number count) and Bid details same then group that request as one .
    then same Bid number but other Bid number is not present then group into other 
    Like similar example the number of bids may vary and bid numbers may vary 

    I was expecting below results .
    Group By Child tables i.e. AccountBids,AccountBidInformation
    AccountBidInformation will be one to one relationship with AccountTable table 
    AccountBids will be one to many relationship with AccountTable
    During Group by AccountBidInformation will have one record and AccountBids are combined with budnumber is one column
    Select distinct GSR,CustomizedClaims,TotalWeeklyVolume,ParentOrVendor,PP,CWT,(Select top 1 
    substring(
    Select ','+ST1.BidNumber  AS [text()]
    From dbo.AccountBids ST1
    Where ST1.AccountTable_ID = ST2.AccountTable_ID--Combine Bids to one row with respect to reference Key 
    ORDER BY ST1.BidNumber
    For XML PATH ('')
    ), 2, 1000) [Bids]
    From dbo.AccountBids ST2 WHERE ST2.AccountTable_ID = AccountBids.AccountTable_ID) 
    FROM AccountBids
    INNER JOIN AccountBidInformation On AccountBids.AccountTable_ID = AccountBidInformation.AccountTable_ID 
    ORDER BY GSR,CustomizedClaims,TotalWeeklyVolume,ParentOrVendor,PP,CWT
     After grouping AccountBids,AccountBidInformation .Select AccountTable records for each group by record 
    SELECT Main.Account_Number,Effective_Date,Details FROM AccountTable Main
     INNER JOIN AccountBids ON AccountBids.AccountTable_ID = Main.AccountTable_ID
     INNER JOIN AccountBidInformation ON AccountBidInformation.AccountTable_ID = Main.AccountTable_ID
    WHERE BidNumber in ('P120012','P120014')--First Record from previous select 
    AND TotalWeeklyVolume = 452  --First Record from previous select 
    AND ParentOrVendor = 'P' --First Record from previous select 
    AND PP = 'N/A' --First Record from previous select 
    AND CWT = 'N/A' --First Record from previous select 
    Exists make sure Number of bids remain same 
    Example : If you remove Exists then Second below query will return two duplicate record which is already selected in this .
    AND EXISTS(
    SELECT  AccountTable_ID          --           
    FROM    AccountBids SUB            --          
    WHERE   Main.AccountTable_ID = SUB.AccountTable_ID
    GROUP   BY AccountTable_ID
    HAVING  COUNT(*) = 2 --Pass number of bids selected from first result w.r.t commo seperated 
    GROUP BY Main.Account_Number,Effective_Date,Details having count(BidNumber) = 2
    SELECT Main.Account_Number,Effective_Date,Details FROM AccountTable Main
     INNER JOIN AccountBids ON AccountBids.AccountTable_ID = Main.AccountTable_ID
     INNER JOIN AccountBidInformation ON AccountBidInformation.AccountTable_ID = Main.AccountTable_ID
    WHERE BidNumber in ('P120012')AND 
    TotalWeeklyVolume = 452 
    AND ParentOrVendor = 'P'
    AND PP = 'N/A'
    AND CWT = 'N/A' AND 
    EXISTS(
    SELECT  AccountTable_ID          --           
    FROM    AccountBids SUB            --          
    WHERE   Main.AccountTable_ID = SUB.AccountTable_ID
    GROUP   BY AccountTable_ID
    HAVING  COUNT(*) = 1 
    GROUP BY Main.Account_Number,Effective_Date,Details having count(BidNumber) = 1
    SELECT Main.Account_Number,Effective_Date,Details FROM AccountTable Main
     INNER JOIN AccountBids ON AccountBids.AccountTable_ID = Main.AccountTable_ID
     INNER JOIN AccountBidInformation ON AccountBidInformation.AccountTable_ID = Main.AccountTable_ID
    WHERE BidNumber in ('P120012','P120014')
    AND TotalWeeklyVolume = 453 
    AND ParentOrVendor = 'N'
    AND PP = 'N/A'
    AND CWT = 'N/A'
    AND EXISTS(
    SELECT  AccountTable_ID          --           
    FROM    AccountBids SUB            --          
    WHERE   Main.AccountTable_ID = SUB.AccountTable_ID
    GROUP   BY AccountTable_ID
    HAVING  COUNT(*) = 2 
    GROUP BY Main.Account_Number,Effective_Date,Details having count(BidNumber) = 2

  • Oracle nested object table

    I've posted this question in sql/plsql forum but it may belong here.
    My question is how can i individually initialize/assign record to my nested table type wf_acts_t or wf_trans_t( either one or the other)?
    It maybe simply a case where I dont know how to accomplish this goal but I've got a workaround.
    CREATE TYPE wf_act_t IS OBJECT (
    a_NAME VARCHAR2 (100)
    CREATE TYPE wf_acts_t IS
    TABLE OF wf_act_t
    CREATE TYPE wf_tran_t IS OBJECT (
    wf_name VARCHAR2 (100)
    CREATE TYPE wf_trans_t IS
    TABLE OF wf_tran_t
    CREATE TYPE act_t IS OBJECT (
    act wf_acts_t,
    tran wf_trans_t
    create type bunch_of_act is table of act_t
    declare
    my_acts bunch_of_act := bunch_of_act();
    v_loop_count BINARY_INTEGER := 1;
    begin
    for wf_lkup_rec in(select * from wf_activities_lkup)
    loop
    my_acts.extend;
    /*here you cannot address wf_acts_t or wf_trans_t individually*/
    my_acts(v_loop_COUNT) :=
    act_t(
    wf_acts_t(wf_act_t(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null)
    wf_trans_t ( wf_tran_t (null))
    v_loop_count :=
    v_loop_count +1;
    end loop;
    v_loop_count := 1;
    dbms_output.put_line (my_acts (1).act(1).a_name);
    end;

    It can be something like that (I'm sorry for
    very silly example):
    SQL> declare 
      2     my_acts bunch_of_act := bunch_of_act(); 
      3     v_loop_count BINARY_INTEGER := 1; 
      4     ptr1 wf_acts_t; 
      5     ptr2 wf_trans_t; 
      6  begin     
      7 
      8    for wf_lkup_rec in(select e.* from emp e where rownum < 3) loop   
      9 
    10     /* Declare new table object*/
    11      ptr1 := wf_acts_t();
    12 
    13     /* Here we fill table individually */
    14     -- Add some loop:
    15 
    16      for k in 1..2 loop
    17       ptr1.extend;    
    18       ptr1(ptr1.last) := wf_act_t(wf_lkup_rec.ename);        
    19      end loop;
    20 
    21     /* Declare new table object*/    
    22      ptr2 := wf_trans_t();
    23 
    24     /* Here we fill table individually */    
    25     -- Add some loop
    26     for k in 1..2 loop
    27       ptr2.extend;
    28       ptr2(ptr2.last) := wf_tran_t(wf_lkup_rec.empno);    
    29     end loop;      
    30 
    31     my_acts.extend;
    32     my_acts(my_acts.last) :=  act_t(ptr1, ptr2);
    33 
    34    end loop;
    35 
    36    /* Individually take elements */
    37 
    38    for j in 1..my_acts.count loop
    39    
    40       dbms_output.put_line('Element ' || j || ' of top colletion contains '); 
    41 
    42       for k in 1..my_acts(j).act.count loop
    43           dbms_output.put_line(' act with name ' || my_acts(j).act(k).a_name); 
    44       end loop;
    45 
    46       dbms_output.put_line('and');
    47 
    48       for k in 1..my_acts(j).tran.count loop
    49           dbms_output.put_line(' tran with id ' || my_acts(j).tran(k).wf_name);
    50       end loop;
    51    
    52    end loop;
    53    
    54  end;
    55  /
    Element 1 of top colletion contains
    act with name SMITH
    act with name SMITH
    and
    tran with id 7369
    tran with id 7369
    Element 2 of top colletion contains
    act with name ALLEN
    act with name ALLEN
    and
    tran with id 7499
    tran with id 7499
    &nbsp
    PL/SQL procedure successfully completed.Rgds.

  • Problem with view based on Object Table

    When I try to create the Invoice view below SQL*Plus returns:
    "ORA-00904: invalid column name"
    My view appears to be correct. I doubt 'Expires' is a reserved word since if I NULL it out then the next column('Issued') causes the same error.
    Any suggestions?
    Here's my layout of types and tables:
    CREATE OR REPLACE TYPE Address_objtyp AS OBJECT (
    Street1 VarChar2(200),
    Street2 VarChar2(200),
    City VarChar2(200),
    State Char(2),
    Zip VarChar2(20)
    CREATE OR REPLACE TYPE CreditCard_objtyp AS OBJECT (
    NameOnCard VarChar2(100),
    Address_obj Address_objtyp,
    CardType VarChar2(50),
    CardNum Number,
    Issued DATE,
    Expires DATE
    CREATE OR REPLACE TYPE Invoice_objtyp AS OBJECT (
    IDNum Number(5),
    InvDate DATE,
    InvType VarChar2(20),
    Fee Number(10,2),
    PaidDate DATE,
    AmtPaid Number(10,2),
    PayMethod VarChar2(50),
    CheckNum Number(10),
    CreditCard_obj CreditCard_objtyp
    CREATE TABLE Invoice_objtab OF Invoice_objtyp (
    PRIMARY KEY (IDNum))
    OBJECT ID PRIMARY KEY;
    CREATE OR REPLACE VIEW Invoice_view OF Invoice_objtyp WITH OBJECT IDENTIFIER DEFAULT
    AS SELECT i.InvDate, i.InvType, i.Fee, i.PaidDate, i.AmtPaid, i.PayMethod, i.CheckNum,
    CreditCard_objtyp(i.NameOnCard, Address_objtyp(i.Street1, i.Street2, i.City, i.State, i.Zip), i.CardType, i.CardNum, i.Issued, i.Expires)
    FROM Invoice_objtab i;

    Missing the IDNum. Create view statement should read:
    CREATE OR REPLACE VIEW Invoice_view OF Invoice_objtyp WITH OBJECT IDENTIFIER DEFAULT
    AS SELECT i.IDNum, i.InvDate, i.InvType, i.Fee, i.PaidDate,
    i.AmtPaid, i.PayMethod, i.CheckNum,
    CreditCard_objtyp(i.NameOnCard,
    Address_objtyp(i.Street1, i.Street2, i.City, i.State, i.Zip),
    i.CardType, i.CardNum, i.Issued, i.Expires)
    FROM Invoice_objtab i;
    null

  • How to join KNA1 table with SOOD, SOST or SOES table?

    Hi,
    I am creating an infoset and I cant join KNA1 with any of the following tables: SOST, SOES or SOOD.
    I am looking to get the following fields from the following table:
    KNA1 - KUNNR: Customer Number
    SOES - STATUS: Status
    SOOD- OBJNAM : Send Method
    SOOD - OBJDES : Document Title
    SOOD - CRONAM : Created by
    SOES- MSGV1 : Recipient
    SOST - STAT - DATE : Send date
    SOST - STAT - TIME : Send time
    I tried adding knvp table to find a common field but cant seem to join them. SOST, SOES and SOOD are easily joined with each other but KNA1 or KNVP cannot be joined, is there any intermediate table that I should use to join these tables to get the customer number against them or is there any other solution. kindly help.
    Regards,
    Moaz

    Hi,
    please try to connect KNA1 with SOOD using
    CALL METHOD cl_binary_relation=>read_links
       EXPORTING
         is_object           = ls_lpor
         it_relation_options = lt_relat
       IMPORTING
         et_links            = lt_links.
    where ls_por-instid = kna1-kunnr, ls_por-typeid = 'KNA1' and ls_por-catid = 'BO'
    and  lt_relat contains a line option 'I' 'EQ' 'NOTE'.
    Regards,
    Klaus

  • Check for same parent and child combination

    hi all i am using oracle 10g. can you please help me in this issue.
    how do i know if the same combination of parent and child present in the table
    key value and value are the values given by user.
    if the user try to create a same profile with same set of key_value and value then that should be avoided
    so how to achieve that.
    example profile already in the table
    -- PROFILE_ID,DETAIL_ID,PARENT_DETAIL_ID,KEY_VALUE, VALUE, LAST_IND
    100,               1,               NULL,                      1,              CDE,     N
    100,               2,              1,                            2,              XXX,     N
    100,               3,              1,                            2,              YYY,    N
    100,               4,              1,                            4,              NEW,    Ynew profile by user -- it should throw an error saying that same profile already present
    -- PROFILE_ID,DETAIL_ID,PARENT_DETAIL_ID,KEY_VALUE,VALUE,LAST_IND
    101,               5,               NULL,                      1,              CDE,    N
    101,               6,              5,                            2,              XXX,    N
    101,               7,              5,                            2,              YYY,    N
    101,               8,              5,                            4,              NEW,    YEdited by: DeepakDevarapalli on Dec 9, 2009 9:48 AM
    Edited by: DeepakDevarapalli on Dec 9, 2009 9:59 AM

    sir i have used your logic, each query works fine and displays the correct results below are the results.
    SELECT   SUBSTR (t.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (PARTITION BY profile_id ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail
                           WHERE profile_id IN (100, 101))
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) t
    GROUP BY ptxtresults from query 1
    profile_values
    1/CDE,2/XXX,2/YYY,4/111
    1/CDE,2/XXX,2/YYY,4/222
    SELECT   SUBSTR (s.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail1)
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) s
    GROUP BY ptxtresults from query 2
    profile_values
    1/CDE,2/XXX,2/YYY,4/111
    but when i tried to combine both and do a minus it throws me an error .
    ORA-00600: internal error code, arguments: [expcmo_strdef1], [27], [27], [], [], [], [], []
    -- target
    SELECT   SUBSTR (t.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (PARTITION BY profile_id ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail
                           WHERE profile_id IN (100, 101))
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) t
    GROUP BY ptxt
    MINUS
    -- staging
    SELECT   SUBSTR (s.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail1)
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) s
    GROUP BY ptxt

  • OBJECT TABLES in DATA WAREHOUSE

    Can anyone give a high level response of the benefits as well as
    drawbacks of using Nested object tables as a permanent means of
    storage in an ORACLE data warehouse. In particular, is there a
    performance enhancement/degradation, maintenance problems,
    scalability etc in comparison to standard HEAP tables.
    Most books that I have read suggest NOT to use object tables as
    a permanent means of storage.
    Thanks for any help that you can provide.

    Hi Hakan,
    it's not easy to give a quick answer here.
    a) you want to compare warehouse tables with spatial tables
    To answer this very well you should define what is a warehouse table and what is a spatial table. In this forum you will get for spatial tables the definition "A spatial table is a table with one or more columns of type SDO_GEOMETRY". How do you define a spatial table and how do you define a warehouse table?
    b) you ask for performance
    Performance is not depending only on table type. Performance is depending on a lot of steps. For example on the work which has to be done to answer the question, can data read from buffer cache or must they be read from physical devices, execution plan .....
    I don't know if there is a official statement from Oracle which is usefull to answer your query.
    Can you ask a little bit particular please?
    In my experience there it is not adviseable to store tables in different databases (instances) when I have to query it together. If you split the tables in different instances, the execution has much more overhead because you have to talk to 2 instances and it will very hard for the optimizer to find the best execution plan.
    Regards
    U. Martin

  • Parent-Child using messageChoice to table

    I have a UIX form that has two components on it. A <messageChoice> that is displaying parent data (e.g. departments) and a <table> that is displaying the employees in the department.
    I would like to be able to select a department from the <messageChoice> and have the employees displayed in the <table>.
    The model includes a viewlink between the parent table and the child table to force the relationship.
    When I create the <messageChoice> as a LOV I get a message in the "List Binding Editor" that says:
    "You have selected a detail data collection as the target (data collection) and master data collection as the source (data collection).
    Target data collection will not be modified but navigated based on the selection in the LOV.
    Want to proceed?"
    (This looks ok to me.)
    I build the rest of the page and have tried to add an event action to the <messageChoice> but I have not been able to get the parent VO to be set to the selected record so that the child will display the associated data. The first record that is showing has the correct child records.
    The UIX looks like this:
    <messageChoice id="mcSID" model="${bindings.Dept}">
    <contents childData="${bindings.Dept.displayData}">
    <option model="${uix.current}"/>
    </contents>
    <primaryClientAction>
    <fireAction event="selectDID" formSubmitted="false">
    <parameters>
    <parameter key="currentDID" value="${bindings.Did}"/>
    </parameters>
    </fireAction>
    </primaryClientAction>
    </messageChoice>
    <spacer width="10" height="10"/>
    <styledText text="CURRENT DID: "/>
    <styledText text="${param.currentDID}"/>
    I believe that I need to be able to trap the id of the record that has been selected so that the parent VO can be set to this value. The child VO should follow suit. However, I am not able to get the value from the messageChoice. How can I get this to work?

    Hi Vince -
    I spent some time yesterday trying to put together a solution based on the Employees/Departments tables of the HR sample schema. Like you, I started by trying to bind the mesageChoice such that the Departments view object is used for the source data collection and the Employees view object on the other side of the view link is the target data collection. When creating the binding, I too saw the "Target data collection will not be modified but navigated based on the selection in the LOV" message, which seemed like a good sign. Although the messageChoice does get populated correctly, no records are found when I try to select a new department.
    I recruited a co-worker who has more experience working with ADF BC to help out, and he proposed a slightly different solution, which we were able to get up and running. I'm not sure whether this is necessarily the best solution, and there most certainly are other ways to accomplish the same functionality, but the solution seems to work fairly well, so I thought it would be worth sharing.
    The main change in new solution has to do with the target data collection that is used when setting up the list binding. In the earlier solutions that both you and I attempted, the target data collection is the "detail" view object itself (ie. the Employees view object hanging off of the Departments view object via a view link). Instead of going this route, my colleague suggested using an intermediate "transient" view object to hold the result of the list selection. This view object is linked to a new instance of the Employees view object. The idea is that when the list selection changes, it is applied to the new transient view object, which in turn restricts the employees that are included in the linked Employees view object.
    Here are steps we followed to get this up and running:
    1. Create the basic data model
    We used the HR schema, and created view objects from the EMPLOYEES and DEPARTMENTS tables. This produced an application module with the following view objects:
    - EmployeesView1: All employees
    - DepartmentsView1: All departments
    - EmployeesView3: View of employees linked to DepartmentsView1
    2. Define a transient view object for holding selection data
    Using the "Create View Object" wizard, we set up the view object as follows:
    Step 1: Set name to "TransientDepartmentsView"
    Step 2: Do not select any entities (since the view object is transient)
    Step 3: Create a new attribute named "DepartmentId". Set the type to "Number". Set updateable to "Always". Check "Selected In Query". Set Alias to "DEPARTMENT_ID".
    Step 4: Leave attribute settings as is
    Step 5: Set query to "SELECT 10 AS DEPARTMENT_ID FROM DUAL".
    Accept all other defaults in remaining steps and finish.
    The new view object has a single attribute "DepartmentId", which will be used to store the results of the list binding. The "SELECT 10 AS DEPARTMENT_ID FROM DUAL" serves two purposes. The "FROM DUAL" clause ensures that the view object only ever contains a single row. The "SELECT 10 AS DEPARTMENT_ID" ensures that a default department id (10) is provided, so that the initial page render will display the employees from the default department.
    3. Define a view link between the TransientDepartmentsView and EmployeesView
    In the "Create View Link" wizard, enter the following values:
    Step 1: Set name to "TransientEmpDeptFKLink".
    Step 2: Select the TransientDepartmentsView's DepartmentId attribute for the source. Select the EmployeesView's DepartmentId for the destination. Click Add.
    Accept all other defaults in remaining steps and finish.
    5. Add new view object instances to the application module.
    In steps 3 and 4, we enhanced our model definition to include a new view object and view link. Now, we need to create instances of these objects in the application module, as follows:
    - Double click on the AppModule node in the Applications Navigator to bring up the Application Module editor.
    - Select the "Data Model" node to display the available model objects.
    - Select the TransientDepartmentsView node in the "Available View Objects" pane.
    - Click the right arrow button to add a new instance to the application module. You should see a new view object instance named "TransientDepartmentsView1" appear in the Data Model pane, which should be selected.
    - Back in the Available View Objects pane, select the "EmployeesView via TransientEmpDeptFKLink" node. Leaving the "TransientDepartmentsView1" node selected on the Data Model pane, click the right arrow. You should now see an "EmployeesView4 via TransientEmpDeptFKLink1" node appear under the "TransientDepartmentsView1" node in the Data Model pane.
    - Click OK
    At this point we're done preparing the data model. Before we move on, we can test the model in the Oracle Business Component Browser. Bring up the BC Browser by right-clicking on the "model" node in the Application Navigator and selecting "Run". You should see our new transient view object and link under the application module. If you double-click the TransientEmpDeptFKLink1, you should see a "DepartmentId" field linked to the employees view. Try entering a new department id (eg. "90") into the field and hit enter. The emloyees list should be filtered accordingly.
    6. Set up the page flow.
    In my sample, I just add a single Data Page ("/dataPage1") to the struts-config.xml. To create the corresponding UIX page, double click the Data Page node and select "/dataPage1.uix".
    7. Create the messageChoice and set up list binding.
    In the Data Control pallete, select the DepartmentId attribute of the TransientDepartmentsView1 view object. Set "Drag and Drop As:" to "MessageChoice", and drag the DepartmentId node to the UIX page. This brings up the List Binding Editor.
    In the List Binding Editor, change the List Binding Mode to "LOV Mode". The target data collection should already be populated. Select DepartmentsView1 for the source data collection, since we want to display all available departments in our messageChoice. Click New/OK to create a new source iterator. Click Add and verify that both the source and target attribute is "DepartmentId".
    In the LOV Display Attributes pane, select DepartmentId and/or DepartmentName as desired.
    8. Set up the client action.
    From the property inspector, launch the primaryClientAction editor. Select "Fire action by submitting Form" and click OK. This will set up a <primaryClientAction> element in your uiXML code. By default, the fireAction client action assumes a default event named "update". We don't want to fire a UIX event - we just want to submit the form and allow ADF to handle the postback. So, to suppress the default "update" event, go into your uiXML and add 'event=""' to the <fireAction> element. Your <fireAction> element should look like this:
    <fireAction event="" formSubmitted="true"/>
    9. Set up the employees table.
    Back in the data control palette, select the "EmployeesView4" node, which should be under the "TransientDepartmentsView1" node. Make sure "Drag And Drop As: " is set to "Read-Only Table", and Drag the EmployeesView4 node onto the UIX page. You should see the table appear with appropriate bindings.
    At this point, you should be good to go. Try running the /dataPage1 Data Page from the struts-config.xml editor. When the page first comes up, you should see the default department selected (in our sample, that would be 10/Administration) and the table should display the corresponding employees. When a new department is selected, the <fireAction> triggers a form submission. This in turn causes the selected value to be applied to the transient departments view object, and the linked employees view object to be filtered accordingly. When the page is re-rendered, the employees table should be updated to reflect the currently selected department.
    Hope this helps solve your problem. As I mentioned above, I'm sure there are other ways to do this. If anyone has recommendations for a simpler solution, please let us know!
    Andy

  • Hello Gurus..... ISSUE with child Table update

    I have an issue with child table update
    I have created a GTC with one parent table and two child tables. I'm able to update the parent table and the values are found in db, but the ISSUE is the child Table values are not updating the db.
    please give me a solution
    regards
    Srikanth

    If you are keeping referential integrity in the database, not in the application, it is easy to find the child and parent tables. Here is a quick and dirty query. You can join this to dba_cons_columns to find out on which columns the referential constraints are defined. This lists all child-parent table including SYS and SYSTEM users. You can run this for specific users of course.
    select cons1.owner child_owner,cons1.table_name child_table,
    cons2.owner parent_owner,cons2.table_name parent_table
    from dba_constraints cons1,dba_constraints cons2
    where cons1.constraint_type='R'
    and cons1.r_constraint_name=cons2.constraint_name;

  • Insert data Flatfile table to Parent and child tables

    Hi All,
        I have Flatfile table which is we getting from daily txt files and i want to populate flatfile data to parent as well as child tables. parent table has primary key as ID. This ID is foreign key of child tables. 
    Here i have mentioned our process.
    1. Flatfile duplicates has to remove with condition of daily date.
    2. Before Insert parent table have to check duplicate(we have Unique key of 4 columns in parent) if duplicate is there we have to delete duplicate then Insert into parent table unique records(Primary key is ID).(here why we are delete duplicate record meaning
    we getting daily files so if any records updated in future that record should be insert to parent and child table so only we delete old records and insert new records).
    3.After insert parent we have to populate child tables from Flatfile table as well as we have to insert parent table primary key as foreign key of child tables.
    4. if any truncation error occurs that errors should go to error log table.
    Right now we are using cursor for this concept and cursor has performance issue. so we are trying to optimize other way to populate parent and child table to increase performance to populate.
    Please help us to which way to do this process increase of performance .
    Please  can any one reply.

    Hi RajVasu,
    Since this issue is related to Transact-SQL, I will move this thread to Transact-SQL forum. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Parenting and child control with AS3

    Hi,
    I'm new to AS3 and although I can see some good practice and functionality I'm constantly getting stucked and can't yet make things that I would do so easily with AS2 - I almost need to relearn it from scratch!. Still I would appreciate some help and guidance on this...
    I made a class that creates a "kind" of menu with data from a XML file and basically what it does when it is called is create a emptyMC (a container), add a childMC (a square) and add another child (a text label). When I create the container I'm trying to add a MouseEvent that can act on each the container instances but all I can get is a MouseEvent on object containing all the added MCs. The code follows.
    Can anyone enlight me with this issue or explain what am I doing wrong.
    I can't understand well the dynamic parenting with AS3 and the lack of using instance names and dot parenting doesn't help.
    Thanks in advance.
    Note to Adobe: Previous versions of Flash Help Files and AS reference were by far more helpful than in CS4!
    In the timeline:
    import assets.myDynMenu;
    var theMenu:myDynMenu = new myDynMenu("menu.xml");
    stage.addChild(theMenu)
    stop();
    In the class:
    package assets
         import flash.display.*;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import flash.net.*;
         public class myDynMenu extends Sprite {
              // INIT EXTERNAL DATA LOAD
              public function myDynMenu(theData) {
                   // LOADS THE MENU DATA FROM PREFORMATTED XML
                   var loader:URLLoader = new URLLoader();
                   var url:URLRequest = new URLRequest(theData);
                   loader.addEventListener(Event.COMPLETE, buildTheMenu);
                   loader.load(url);
              // XML MENU DATA LOAD CHECK - ON COMPLETE BUILD OBJECT AND CHILDREN
              public function buildTheMenu(event:Event):void {
                   var xml:XML = new XML(event.target.data);
                   for (var i=0; i<xml.menuData.menuItem.length(); i++) {
                        // ADDS A CONTAINER
                        var itemContainer:MovieClip = new MovieClip();
                        itemContainer.name = "menu" + i;
                        // THE NEXT LINE DOESN'T ACT AS I WISHED?!
                        // IN THE FUNCTION CALLED I NEED TO CONTROL THIS ITEM AND ITS CHILDREN
                        itemContainer.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
                        itemContainer.x = 100 * i;
                        itemContainer.y = 0;
                        itemContainer.mouseEnabled = true;
                        itemContainer.mouseChildren = false;
                        addChild(itemContainer);
                        // ADDS A CHILD TO CONTAINER (a square)
                        var itemBase:MovieClip = new MovieClip();
                        itemBase.graphics.beginFill(xml.menuData.mConfig.mainItemColor);
                        itemBase.graphics.drawRect(0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mConfig.mainIt emH);
                        itemBase.graphics.endFill();
                        itemBase.name = "base" + i;
                        itemBase.mouseEnabled = false;
                        itemBase.mouseChildren = false;
                        itemContainer.addChild(itemBase);
                        // ADDS ANOTHER CHILD TO CONTAINER (a text label)
                        var theLabel:TextField = new TextField();
                        theLabel.x = 5;
                        theLabel.y = 5;
                        theLabel.selectable = false;
                        theLabel.mouseEnabled = false;
                        theLabel.border = true;
                        theLabel.text = xml.menuData.menuItem[i].mName;
                        itemContainer.addChild(theLabel);
              // THIS IS THE MOUSE OVER THAT I NEED TO ACT ON EACH itemContainer (AND CHILDREN)
              private function onMouseOver(event:MouseEvent):void {
                   event.stopPropagation();
                   trace("You are over " + this.name );

    use:
    package assets
         import flash.display.*;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import flash.net.*;
         public class myDynMenu extends Sprite {
              // INIT EXTERNAL DATA LOAD
              public function myDynMenu(theData) {
                   // LOADS THE MENU DATA FROM PREFORMATTED XML
                   var loader:URLLoader = new URLLoader();
                   var url:URLRequest = new URLRequest(theData);
                   loader.addEventListener(Event.COMPLETE, buildTheMenu);
                   loader.load(url);
              // XML MENU DATA LOAD CHECK - ON COMPLETE BUILD OBJECT AND CHILDREN
              public function buildTheMenu(event:Event):void {
                   var xml:XML = new XML(event.target.data);
                   for (var i=0; i<xml.menuData.menuItem.length(); i++) {
                        // ADDS A CONTAINER
                        var itemContainer:MovieClip = new MovieClip();
                        itemContainer.name = "menu" + i;
                        // THE NEXT LINE DOESN'T ACT AS I WISHED?!
                        // IN THE FUNCTION CALLED I NEED TO CONTROL THIS ITEM AND ITS CHILDREN
                        itemContainer.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
                        itemContainer.x = 100 * i;
                        itemContainer.y = 0;
                        itemContainer.mouseEnabled = true;
                        itemContainer.mouseChildren = false;
                        addChild(itemContainer);
                        // ADDS A CHILD TO CONTAINER (a square)
                        var itemBase:MovieClip = new MovieClip();
                        itemBase.graphics.beginFill(xml.menuData.mConfig.mainItemColor);
                        itemBase.graphics.drawRect(0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mCon fig.mainItemH);
                        itemBase.graphics.endFill();
                        itemBase.name = "base" + i;
                        itemBase.mouseEnabled = false;
                        itemBase.mouseChildren = false;
                        itemContainer.addChild(itemBase);
                        // ADDS ANOTHER CHILD TO CONTAINER (a text label)
                        var theLabel:TextField = new TextField();
                        theLabel.x = 5;
                        theLabel.y = 5;
                        theLabel.selectable = false;
                        theLabel.mouseEnabled = false;
                        theLabel.border = true;
                        theLabel.text = xml.menuData.menuItem[i].mName;
                        itemContainer.addChild(theLabel);
              // THIS IS THE MOUSE OVER THAT I NEED TO ACT ON EACH itemContainer (AND CHILDREN)
              private function onMouseOver(event:MouseEvent):void {
                   event.stopPropagation();
                   trace("You are over " + event.currentTarget.name );

  • General Query to identify parent columns and child columns in a table

    Does anyone know a general query that can be run to identify the child records associated with the parent column within a single table.....and between other tables?
    Am I correct in assuming the parent column is the 'primary key'?
    Thanks.....I'm a new to oracle...and need some help understanding
    my company's crazy DB structure

    You can use
    User_Constraints
    User_Cons_Columns
    views to identify parent and child table columns
    SELECT * FROM User_Constraints WHERE Constraint_Type = 'R' AND Table_Name = '<TABLENAME>';
    SELECT * FROM User_Cons_columns WHERE Constraint_Name = '<Name from Above query>';
    will give you columns of the parent table (if you use value from constraint_name) and of child table (if you use value from r_constraint_name).
    HTH..

  • How to update parent and child tables while updating parent table

    I have a parent table EMPLOYEE which includes columns (sysid, serviceno,employeename...) sysid is Primary key, serviceno is Unique key and I have child table DEPENDENT includes columns (sysid,employee_sysid,name,dob...) here again SYSID is primary key for DEPENDENTS table, employee_sysid is Foreign key of EMPLOYEE table.
    Now I want to change SYSID (using sequence) in EMPLOYEE table which need to be update in DEPENDENTS table as well
    Note: I have 10000 records in EMPLOYEE table as well as I have 5 more child tables which need to update new SYSID.
    please help me

    first disable the FOREIGN KEY Constraints.
    you can update Parent as well as Child record also with help of trigger.
    here i am giving you one examlpe..it may help u.
    create table parent(id number primary key,name varchar2(100))
    create table child_1(id number primary key,p_id number,dob date,
    CONSTRAINT FK_id FOREIGN KEY (p_id) REFERENCES parent (ID))
    create table child_2(id number primary key,p_id2 number,addr varchar2(1000),
    CONSTRAINT FK_id2 FOREIGN KEY (p_id2) REFERENCES parent (ID))
    insert some test data to parent and child tables.
    alter table child_2 disable constraint FK_id2
    alter table child_1 disable constraint FK_id2
    CREATE OR REPLACE TRIGGER delete_child
    BEFORE UPDATE ON parent
    FOR EACH ROW
    BEGIN
    UPDATE CHILD_1
    SET P_ID=:NEW.ID
    WHERE P_ID=:OLD.ID;
    UPDATE CHILD_2
    SET P_ID2 =:NEW.ID
    WHERE P_ID2=:OLD.ID;
    END;
    then Upadte parent table primary key col and check the child tables.
    then enable the constraints...

  • Mix object tables with relational tables?

    Hallo,
    is it possible to mix object tables with relational tables in one database?
    I didn't succeed in assigning a foreign key from a relational table to an object table.
    Is this only working with column objects in relational tables?

    Hi
    is it possible to mix object tables with relational tables in one database?
    Every database contains both types of tables. So, it is basically not a problem.
    I didn't succeed in assigning a foreign key from a relational table to an object table.
    Is this only working with column objects in relational tables?It would be interesting to know how you tried... e.g. what error you get... Here an example (executed on 11.1).
    SQL> create or replace type tt as object ( n number );
      2  /
    SQL> create table ot of tt (constraint ot_pk primary key (n));
    SQL> create table rt (n number, constraint rt_ot_fk foreign key (n) references ot (n));
    SQL> insert into ot values (tt(1));
    SQL> insert into rt values (1);
    SQL> insert into rt values (2);
    insert into rt values (2)
    ERROR at line 1:
    ORA-02291: integrity constraint (OPS$CHA.RT_OT_FK) violated - parent key not foundHTH
    Chris

Maybe you are looking for

  • How to change subtotal dinamically in ALV

    Hi all, I have this kind of problem. I'm using an ALV GRID for displaying a set of document with different values in the column. I have set the first column as a checkbox to allow the user to check/uncheck a single line. The problem is that I want to

  • Nvidia problem.

    Hi! first thx to all. I have an " nvidia geforce4 integrated GPU" ( nForce2) y currently use "nv" driver in xorg. But when I use "nvidia" drive Xserver delay about 2 minutes to run. I have been testing with an " nvidia geforce " ( externel) and it ru

  • Undo deletion indicator - internal order

    Hello, we need to undo the deletion indicator for couple of internal orders. We have found the SAP note 191216. There is the program ZZSTATUSDEL offered for this purpose. Is the program applicable also for internal orders? Because, within the program

  • Timeline/work question for the pros

    Hey folks, Looking to assess how long a project would take. I'm a mediocre coder at best so I'm wondering for a skilled flash coder, how long would a menu take to build. All artwork would be provided for the project, but simply linking existing butto

  • How can I know a parent class of a certain class? which FM can be used?

    It seems SEO_CLASS_TYPEINFO_GET can not work.