SHOW THE PARENT CHILD TABLE RELATIONSHIP TABLE

hi experts,
I want show the parent child relation ship tables
for exmple iam passing the emp table then display related child tables like dept,grade after that again child table(dept,grade) related to child relationship tables like recursive
Regards,
VENKAT

Probably something like below. This may not be exactly what you are looking for, but one way to get what you are asking for.
Only if you can give specifics, of your Input being passed and the Output, it might be possible to provide more help. But you also need to help us with your best effort on this.
select *
  from (
        select prior table_name Child, table_name Parent
          from user_constraints
         start with constraint_name = some_constraint_name_of_Parent_Table
        connect by constraint_name = prior r_constraint_name
       ) a
where a.child is not null;

Similar Messages

  • Sub Total value is empty in  parent child hierarchy pivot table

    Hi All,
    I am using obiee 11.1.1.6.2 in Test environment. Is it a known issue/bug for 11.1.1.6.2 to show empty/blank values for sub total when using parent child hierarchy pivot table. The sub total for parent value is showing but sub total for child value is coming blank. However, in 11.1.1.5.0, we do not have any issue with this.
    Is it a known bug in obiee 11.1.1.6.2?
    Thanks,
    Sushil

    Yes it is a known bug...
    Thanks.

  • Creating View for a table with parent child relation in table

    I need help creating a view. It is on a base table which is a metadata table.It is usinf parent child relationship. There are four types of objects, Job, Workflow, Dataflow and ABAP dataflow. Job would be the root parent everytime. I have saved all the jobs
    of the project in another table TABLE_JOB with column name JOB_NAME. Query should iteratively start from the job and search all the child nodes and then display all child with the job name. Attached are the images of base table data and expected view data
    and also the excel sheet with data.Picture 1 is the sample data in base table. Picture 2 is data in the view.
    Base Table
    PARENT_OBJ
    PAREBT_OBJ_TYPE
    DESCEN_OBJ
    DESCEN_OBJ_TYPE
    JOB_A
    JOB
    WF_1
    WORKFLOW
    JOB_A
    JOB
    DF_1
    DATAFLOW
    WF_1
    WORKFLOW
    DF_2
    DATAFLOW
    DF_1
    DATAFLOW
    ADF_1
    ADF
    JOB_B
    JOB
    WF_2
    WORKFLOW
    JOB_B
    JOB
    WF_3
    WORKFLOW
    WF_2
    WORKFLOW
    DF_3
    DATAFLOW
    WF_3
    WORKFLOW
    DF_4
    DATAFLOW
    DF_4
    DATAFLOW
    ADF_2
    ADF
    View
    Job_Name
    Flow_Name
    Flow_Type
    Job_A
    WF_1
    WORKFLOW
    Job_A
    DF_1
    DATAFLOW
    Job_A
    DF_2
    DATAFLOW
    Job_A
    ADF_1
    ADF
    Job_B
    WF_2
    WORKFLOW
    Job_B
    WF_3
    WORKFLOW
    Job_B
    DF_3
    DATAFLOW
    Job_B
    DF_4
    DATAFLOW
    Job_B
    ADF_2
    ADF
    I implemented the same in oracle using CONNECT_BY_ROOT and START WITH.
    Regards,
    Megha

    I think what you need is recursive CTE
    Consider your table below
    create table basetable
    (PARENT_OBJ varchar(10),
    PAREBT_OBJ_TYPE varchar(10),
    DESCEN_OBJ varchar(10),DESCEN_OBJ_TYPE varchar(10))
    INSERT basetable(PARENT_OBJ,PAREBT_OBJ_TYPE,DESCEN_OBJ,DESCEN_OBJ_TYPE)
    VALUES('JOB_A','JOB','WF_1','WORKFLOW'),
    ('JOB_A','JOB','DF_1','DATAFLOW'),
    ('WF_1','WORKFLOW','DF_2','DATAFLOW'),
    ('DF_1','DATAFLOW','ADF_1','ADF'),
    ('JOB_B','JOB','WF_2','WORKFLOW'),
    ('JOB_B','JOB','WF_3','WORKFLOW'),
    ('WF_2','WORKFLOW','DF_3','DATAFLOW'),
    ('WF_3','WORKFLOW','DF_4','DATAFLOW'),
    ('DF_4','DATAFLOW','ADF_2','ADF')
    ie first create a UDF like below to get hierarchy recursively
    CREATE FUNCTION GetHierarchy
    @Object varchar(10)
    RETURNS @RESULTS table
    PARENT_OBJ varchar(10),
    DESCEN_OBJ varchar(10),
    DESCEN_OBJ_TYPE varchar(10)
    AS
    BEGIN
    ;With CTE
    AS
    SELECT PARENT_OBJ,DESCEN_OBJ,DESCEN_OBJ_TYPE
    FROM basetable
    WHERE PARENT_OBJ = @Object
    UNION ALL
    SELECT b.PARENT_OBJ,b.DESCEN_OBJ,b.DESCEN_OBJ_TYPE
    FROM CTE c
    JOIN basetable b
    ON b.PARENT_OBJ = c.DESCEN_OBJ
    INSERT @RESULTS
    SELECT @Object,DESCEN_OBJ,DESCEN_OBJ_TYPE
    FROM CTE
    OPTION (MAXRECURSION 0)
    RETURN
    END
    Then you can invoke it as below
    SELECT * FROM dbo.GetHierarchy('JOB_A')
    Now you need to use this for every parent obj (start obj) in view 
    for that create view as below
    CREATE VIEW vw_Table
    AS
    SELECT f.*
    FROM (SELECT DISTINCT PARENT_OBJ FROM basetable r
    WHERE NOT EXISTS (SELECT 1
    FROM basetable WHERE DESCEN_OBJ = r.PARENT_OBJ)
    )b
    CROSS APPLY dbo.GetHierarchy(b.PARENT_OBJ) f
    GO
    This will make sure it will give full hieraracy for each start object
    Now just call view as below and see the output
    SELECT * FROM vw_table
    Output
    PARENT_OBJ DESCEN_OBJ DESCEN_OBJ_TYPE
    JOB_A WF_1 WORKFLOW
    JOB_A DF_1 DATAFLOW
    JOB_A ADF_1 ADF
    JOB_A DF_2 DATAFLOW
    JOB_B WF_2 WORKFLOW
    JOB_B WF_3 WORKFLOW
    JOB_B DF_4 DATAFLOW
    JOB_B ADF_2 ADF
    JOB_B DF_3 DATAFLOW
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Parent-Child Join on tables in Database Adapter

    Hi,
    We are doing a join on two tables(T1 and T2) in Database adapter for an Insert operation. There is no Reference Integrity between these two tables in Database, but join is done through bpel database adapter.
    Here is a scenario - when we try to insert a record(parent-child), into these two tables, If there is any data issue in any of the child record, Adapter inserts parent-record, also inserts few child-records it processed before it encountered this data issue and terminates.
    Issue here is , We want this to be transactional, it means, If any of the child record fails adapter should rollback the entire insert operation both from parent and child tables and exit with an error. Instead BPEL inserting half records into child table.
    Is there any parameter I need to set or am I missing anything? Someone please suggest.
    Thanks,
    Phani

    There are a few options I guess.
    1. Add the referential key constraint.
    2. Add custom logic in your BPEL project to compensate for any errors you encounter in your BPEL processes.

  • How to filter parent & child rows from tables while export usingData export

    Hi,
    I have a requirement of export schema. Assume there is a account details table and account transactions table under schema.They have parent child relation exist. if i filter accounts from account details the corresponding transactions in account transactions table should be filterd.How to achieve this?
    Regards,
    Venkat Vadlamudi
    Mobile:9850499800

    Not sure if this is a SQL and PL/SQL question or whether it's an Oracle Apps type question or a Database General.
    Whatever, you've posted in the wrong forum (http://forums.oracle.com/forums/ann.jspa?annID=599)
    You should post in a more appropriate forum e.g.
    PL/SQL
    General Database Discussions
    etc.
    locking this thread

  • How to Get the Parent - Child Relationship

    Hi ,
    In my application having 100 tables with parent - child releation ship without using casecade constraints
    i want to delete the parent with child and sub child records
    Example
    Table - 1
    parent1
    child 2
    Table - 2
    Child 1 - Parent 1
    Parent 2
    Table - 3
    Child 1 - Parent 2
    Parent 3
    Table - 4
    Child 1 - Parent 3
    How to delete the parent table ? Is it any scripts available ?
    Regards
    Sudhakar P.

    Hi,
    1) Firstly identify the parent tables using
    SELECT a.table_name, 0
    FROM user_tables a, user_tab_columns b
    WHERE a.table_name = b.table_name
    store these in one table say ID_table
    2) Identify dependent tables and sore in table say table_dependency using
    SELECT LEVEL, parenttable, parentcol, childtable, childcol
    FROM (SELECT UNIQUE parenttable, parentcol, childtable,
    b.column_name childcol
    FROM (SELECT p.table_name parenttable,
    k.column_name parentcol,
    k.POSITION pos,
    c.table_name childtable,
    c.constraint_name CONSTRAINT
    FROM all_constraints p,
    all_constraints c,
    all_cons_columns k
    WHERE p.constraint_name =
    c.r_constraint_name
    AND c.r_constraint_name =
    k.constraint_name
    AND p.constraint_type IN ('P', 'U')
    AND c.constraint_type = 'R'
    AND p.table_name != c.table_name
    ORDER BY p.table_name,
    c.constraint_name,
    k.POSITION) a,
    all_cons_columns b
    WHERE a.CONSTRAINT = b.constraint_name
    AND a.pos = b.POSITION)     
    3)Now using these details find tables without cascade rule as below
    SELECT *
    FROM table_dependency
    WHERE child_table IN (
    SELECT DISTINCT table_name
    FROM user_constraints
    WHERE constraint_type = 'R'
    AND delete_rule <> 'CASCADE'
    AND table_name IN (SELECT child_table
    FROM table_dependency)
    AND r_constraint_name IN (
    SELECT constraint_name
    FROM user_constraints
    WHERE table_name IN (
    SELECT table_name
    FROM id_table
    UNION
    SELECT child_table
    FROM table_dependency))
    AND table_name NOT IN (
    SELECT table_name
    FROM id_table));

  • Options for loading parent-child SQL 2005 tables

    I was reading about a few examples of using Table types and a stored procedure to load tables that are joined by a foreign key (parent-child).  Seems straight forward enough.  However, that requires at least SQL 2008 and the system we are using
    is on 2005 still for the time being. As much as I would like to upgrade, there is no time for it, even though we have other 2008 and 2012 instances.  So with that said, what are my options for getting data from BTS to SQL where the destination is 2 tables
    that have relations.  
    There are probably a dozen or more, but my first thought is a stored procedure with an xml parameter, then use xquery and xpath statements to pull the data out and insert.  TRY/CATCH and RAISEERROR to return error codes back to the BTS application.
    Thoughts?

    First, how many records are you dealing with?  I don't even think of terms of 'bulk' until 10,000 or so.  And once that threshold is crossed, the first tool out of the box is SSIS.
    Second, are you debatching or is there a triple confirmed requirement that all records be loaded in a single transaction?
    Finally, the 'DB round-trip' issue is often misunderstood in real world settings.  In a typical db transaction, the most expensive operation is establishing the connection.  Once that's done, the SQL Client is very efficient in transporting data
    to and from the database.  Since the wcfSqlBinding uses a Connection Pool, that setup is only done once to some high-water mark.
    Consider, the data has to be sent no matter what and in every conseivable scneario*, the byte count of a stored procedure over TDS would be less than sending the same data wrapped in Xml.  The network adds considerable latency to the conversation. 
    This is why I'm skeptical of using OPENXML() without a provable benefit.
    So, don't get caught up in theoritical 'performance' issues without understanding the entire scenario first.
    *SQL Code being the primary exception.

  • Parent Child In Same Table Management

    I have a simple entity (Process) which has ID and Name.
    It also has Parent property which reference the parent Process of this one.
    When the user ask to delete a process, I have to disconnect its children from it, otherwise I'll have a reference integrity violation, and the logic of the application permit to delete a process in the middle of hierarchy.
    The question is where is it best to put the code that will handle it?
    In a session bean managing the processes, the bad thing is that there are other places that delete processes. so the logic will be have to be duplicated.
    Maybe in an entity listener, the problem is how to get hold of an EntityManager there to update the child processes when a parent process is deleted?
    Thank you,
    Ido.

    Hi,
    In a CONNECT BY query, related rows will always come together. That is, if row r p has children, then the row immediately after p will be one of p's children, and all of the descendants of p will come before any row that is not a descendant of p.
    An ORDER BY clause will cancel the above, but an ORDER SIBLINGS BY clause will keep to the rules above.
    For example:
    SELECT     *
    FROM     t1
    START WITH        col1  NOT IN ( SELECT  col2
                                               FROM        t1
                             WHERE   col2        IS NOT NULL
    CONNECT BY         col1  = PRIOR col2
    ORDER SIBLINGS BY  id               -- Optional
    ;It just so happens that the rows appear in order by id. It might have been better if you had chosen ids that did not show the correct order.
    The tricky part of the CONNECT BY query above is choosing the START WITH set. There's noting in each row by itself that tells if a row is a root; you have to do a sub-query to find all the children, and START WITH a row if it is not on that list.

  • [CS2 JS] Get the parent paragraph of a table

    Hi,
    Anybody here who knows how to get the parent paragraph of a selected table?
    var myTable = app.selection[0];
    var myStory = myTable.parent.paragraphs;
    The script above gives me all the paragraphs of the parent text frame. I want to know the index of the paragraph where my selected table is.
    Appreciate the help you can give. Thanks!

    from VB6 ObjectBrowser (PC):
    Property StoryOffset As InsertionPoint
    read-only
    Member of InDesign.Table
    The location of the Table in the parent story.
    so (VB6):
    myTable.StoryOffset.Paragraphs.Item(1)
    should give you paragraph
    robin
    www.adobescripts.com

  • Regarding generating levels in the parent-child relationship--- using BODS

    Hi Experts,
    I got a problem in generating the level for the child attribute at which it stands in the hierarchy. I have 2 columns in my input file one for parent_no and other for child_no. I need to generate the level of the child_no in the total hierarchy structure. I used vertical hierarchical_flattening but it is not generating the requied output, it is generating the tree structure for each and every node in the hierarchy.
    What I need is my output file must contain the same number of rows as the input file and it must have an added column to it showing the level the child_no is in the hierarchy.
    Kindly, give me some suggessions for aquiring the same.
    Thanks in advance.
    Edited by: Sudheer_157 on Jul 20, 2009 9:21 AM

    Hi SubhadipRoy, I think you might need to create a procedure for this task.
    Because in SSIS, we cannot directly get the Identity ID.
    As my experience, there were serveral ways to do. But all are workaround.
    So, My suggestion is.
    In SSIS:
    1. Create a DataFlow
    2. Drag a flat source and load the data from dat file
    3. Create a procedure which receive the parameter from your data of each row.
    4. Drag a OLEDBCommand to the Panel and Invoke the Procedure also don't forget to pass all your rows to the Procedure in OLEDBCommand control.
    5. In Procedure, after insert 1 row you could get the Identity ID throuth SCOPE_IDENTITY()
    That's it, hope it works for you even this may not the efficency way.
    Althrough, I expect someone can give the best way if there is.

  • The Parent-Child Hierarchy can't be queried in any intermediate node

    Hi All,
    I've created a Parent-Child Hierarchy with Obiee 11g(11.1.1.3).
    I can use the filter to select any Root-Node and it can be expanded correctly.But if I choose any intermediate node,it can't be expanded.Then what can I do?
    Thanks in advance!
    Edited by: Needn on 2011-9-8 下午8:42

    Thx for your advice,but my qusetion has not been solved.
    I don't know how to use these function in the analytics page.Must I modify its default SQL and apply mine?
    Its default SQL like the following ,then how can I modify it to achieve my purpose?
    SELECT s_0, s_1, s_2, s_3, s_4 FROM (
    SELECT
    *0 s_0,*
    *"model"."DIM_PROD_COST_CATEGORY"."CATEGORY_NAME" s_1,*
    CASE WHEN ISLEAF("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim") THEN 1 ELSE 0 END s_2,
    IDOF("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim") s_3,
    PARENT("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim") s_4
    FROM "model"
    WHERE
    ISROOT("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim")
    *) djm ORDER BY 1*

  • How can I list all folders that contain files with a specific file extension? I want a list that shows the parent folders of all files with a .nef extension.

    not the total path to the folder containing the files but rather just a parent folder one level up of the files.
    So file.nef that's in folder 1 that's in folder 2 that's in folder 3... I just want to list folder 1, not 2 or 3 (unless they contain files themselves in their level)

    find $HOME -iname '*.nef' 2>/dev/null | awk -F '/'   'seen[$(NF-1)]++ == 0 { print $(NF-1) }'
    This will print just one occurrence of directory
    The 'find' command files ALL *.nef files under your home directory (aka Folder)
    The 2>/dev/null throws away any error messages from things like "permissions denied" on a protected file or directory
    The 'awk' command extracts the parent directory and keeps track of whether it has displayed that directory before
    -F '/' tells awk to split fields using the / character
    NF is an awk variable that contains the number of fields in the current record
    NF-1 specifies the parent directory field, as in the last field is the file name and minus one if the parent directory
    $(NF-1) extracts the parent directory
    seen[] is a context addressable array variable (I choose the name 'seen'). That means I can use text strings as lookup keys.  The array is dynamic, so the first time I reference an element, if it doesn't exist, it is created with a nul value.
    seen[$(NF-1)] accesses the array element associated with the parent directory.
    seen[$(NF-1)]++ The ++ increments the element stored in the array associated with the parent directory key AFTER the value has been fetched for processing.  That is to say the original value is preserved (short term) and the value in the array is incremented by 1 for the next time it is accessed.
    the == 0 compares the fetched value (which occurred before it was incremented) against 0.  The first time a unique parent directory is used to access the array, a new element will be created and its value will be returned as 0 for the seen[$(NF-1)] == 0 comparison.
    On the first usage of a unique parent directory the comparison will be TRUE, so the { print $(NF-1) } action will be performed.
    After the first use of a unique parent directory name, the seen[$(NF-1)] access will return a value greater than 0, so the comparison will be FALSE and thus the { print $(NF-1)] } action will NOT be performed.
    Thus we get just one unique parent directory name no matter how many *.nef files are found.  Of course you get only one unique name, even if there are several same named sub-directories but in different paths
    You could put this into an Automator workflow using the "Run Shell Script" actions.

  • How to remove the parent-child software update point in sccm 2012 sp1

    I have a CAS , Primary site server(1) and secondary site servers (7). I have software update point installed on CAS, Primary server and Secondary site servers as well.
    I have a situation to reinstall the software update point which is in primary site server.
    So, How to reinstall the software update point in primary site server since this is located in the middle between CAS and secondary site servers.
    So, please suggest me, do I have to do anything special apart from the normal steps to uninstall and reinstall the SUP point on primary site server?
    I have referred few posts on how to remove SUP
    https://social.technet.microsoft.com/Forums/en-US/c7258aad-d968-427b-8826-4829916c14c9/remove-and-re-add-software-update-point-sccm-2012?forum=configmanagersdk
    and how to install SUP
    http://www.windows-noob.com/forums/index.php?/topic/4467-using-sccm-2012-in-a-lab-part-6-deploying-software-updates/

    Hi,
    >> please suggest me, do I have to do anything special apart from the normal steps to uninstall and reinstall the SUP point on primary site server?
    I just tried to reinstall the SUP on the Primary site(only one SUP on Primary site and there is a SUP on Secondary site). The SUP upstream data source of the Secondary site showed empty and greyed out. But the upstream data source resumed after a while.
    It seems nothing special needs to be done.
    Best Regards,
    Joyce
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Parent child hierarcy

    in what report which shows the parent child heirarcy?bcoz i create gl accounts in GL module.....and made parent child heirarcy........i want to see the heirarcy?

    Hello I am not sure about the report but there is something called the Account Hierarchy Manger in R12 where we can view, edit and add parent/child values easily.

  • Parent Child relationship is lost in new table

    Hi Guru's
    I am creating a table from a flat file that is currently in a parent child hierarchy to a staging table in Oracle. I have added a nextval sequence in a Row column, but after loading the flat file, and ordering by the column, the parent child hierarchy is still not listing correctly. I have to do other ETL on the table and I wanted to then load this metadata into Planning, but naturally it is not loading b/c the hierarchy is not recognized. Is there a way to to keep the parent/child hierarchy integrity?
    Thanks for the help

    I have used that in the final integration from a Oracle table to the Planning application. I guess the issue is that I need to load the flat file to an oracle table first. I have loade it with the file to sql KM and created a sequence.nextval column in that table. When I try to order by my column here, the file is no longer in the 'Parent' 'Child' order any longer. I have the Sort_Parent_Child option True, as well as the Load_Order_by_Input = True. My process runs File to SQL -> custom Procedure -> then IKM SQL to Planning so I am not sure if the last KM would recoginize the original order of the flat file input. Am I missing something?
    Thanks in advance.

Maybe you are looking for

  • Does Google Pubilic DNS block Spamhaus RDNSBL queries?

    Our ISP here in Northwest Arizona is CableONE.  We noticed late last year some problems with some of their DNS resolving servers and decided to cut over, as whole, to using Google's Public DNS servers (8.8.8.8 and 8.8.4.4 respectively).  We didn’t re

  • Getting multiple copies of iPhoto slideshow when I burn a dvd - why?

    I just learned how to create a slideshow in iPhoto and struggled through the learning curve to be able to burn it as it appears in iPhoto. I got so excited today when I burned a dvd and it actually played on my TV's dvd player, though it was missing

  • ABAP Webdynpro - Populating second table based on data selected on first

    Hi Experts,   I am new to ABAP Webdynpro. I have a requirement to show a search area, one table for header info, and second table for populating item level information.   I was successful building a search area and populating first table when the 'Se

  • Which field carries the "reson for rejection" text to the smartforms?

    Hi All, In the portal if the user returns an item then he needs to give the reason for the rejection/return.. Can anybody tell me which field carries this data (Reason for rejection) to the smartform.. The field reason_code in the structure bbp_pds_c

  • Can't turn off auto quantizing

    I'm a little new to Logic, but from what I can tell, I've done everything I should.  I'm trying to record 16th note triplets, and the notes show up as triplets in the piano roll while I'm recording, but then are automatically quantized to straight 16