Parent child replication
Hi All,
Query help:
Oracle Database :10g
suppose i have this tree as rows
parent
child1
child2
CHILD2 parent is CHILD1, and CHILD1 parent is PARENT
Now, i need to replicate this tree something like.
Rep_Parent --parent
Rep_child2 child1
Rep_child3 child2
Need to replicate , REP_PARENT whose parent is PARENT, REP_CHILD2 parent is REP_PARENT , REP_CHILD3 parent is Rep_child2
One more case...
parent
Rep_child1 child1
Need to replicate , in thsi case just need to replicate CHILD1 to REP_CHILD1 having same parent PARENT
I will have some indicators on the records as whether to replicate it or not.Edited by: user8650395 on Nov 17, 2009 4:24 AM
Hi,
Refer link [SYS_CONNECT_BY_PATH|http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions164.htm|connect by] for more information
*009*
Similar Messages
-
Problems with Centralized No Delegation DNS with forest wide replication in a Parent-Child domain
Hi,
I have a parent domain "parent" with a child domain "child" as shown below. There are no delegations and DNS replication is set to forest wide DNS replication for both the child and parent zone. I've read that forest wide replication
in this scenario is not recommended, but no one explains why.
Also, running "dcdiag /test:dns" produces the warning below (expected as child is not a DNS zone)
(test:basic (Basc))
Warning: The Active Directory zone on this DC/DNS server was not found (probably a misconfiguration)
I'm looking at upgrading the domain, then forest functional level to 2008, but want to ensure that this DNS config doesn't cause any issues.
Hoping someone can advise.
The only thing I've noticed is that some SRV records for DCs are not up to date when viewed from other DCs (dns diagnostics and event logs report OK) and all else seems OK.
Thanks
IT Support/EverythingHey Aetius2012, So I am a little confused
What is the current domain/forest functional level?
Normally I would expect to see three dns forward lookup zones in a 2 domain (Parent/Child) environment
2 zones if the domain/forest level is 2000/2003 where the _msdcs zone has not been moved to its own forward lookup zone - see image below
In your environment I would expect to see 3 zones (_msdcs.parent.com, parent.com, child.parent.com) on every domain controller because all zones are replicated forest wide.
I would also expect to see 2 delegation records under the parent.com for _msdcs and child
I know you stated there was no delegations, and would like to understand better by what you mean. Not saying that anything is configured wrong just trying to get clarification on your environment to give you the best answer from the community as possible.
Thanks -
PDW : Hierarchy parent/child
Hi,
I'm working with a PDW Appliance as source and destination.
I need to create a parent/child hierarchy.
My child surrogate key is generated inside my dataflow, then I'm doing the initial loading of all my data minus the surrogate key for the parent column.
I'd like to avoid to run update statements against my destination table (because of the replication) and/or have to create temp tables.
I thought about keeping in memory (Recordset Destination) all my dataset and then doing the look up in a script component before doing the final insert in append mode but the performance are awful.
Any idea ?
Thx for your help.
BertrandrThanks to have remind me about the CacheTransform component :)
The dataset is about 200 000 rows.
I have also tested another option.
Instead of performing an initial load and then look up
I'm doing a multicast pointing to 2 RecordSet Destination.
Both are the same except it's 2 differents object variables.
Then in another dataflow I read both dataset and use a MergeJoin on the business key to get my parent surrogate key.
It works but I need to compare performances with your solution.
Thanks a lot !
Bertrandr -
Query Help with Parent, Child, Child's Child
Hi all,
Need some help with a query. I'm trying to create a stored procedure that is sort of like a Customer, Order, Order, Details. In my situation the tables are different but nevertheless, I want to grab all the fields from the Parent, Child,
and Childs' Child, where the Parent.ParentID = @Parameter. I tried this:
CREATE PROCEDURE [dbo].[spGetCompleteProjectXML]
@ProjectID int = 0
AS
SELECT *,
(SELECT *,
(SELECT *
FROM PageControls
WHERE (PageControls.ProjectPageID = ProjectPages.ProjectPageID))
FROM ProjectPages
WHERE (ProjectPages.ProjectID = @ProjectID))
FROM Projects
WHERE (ProjectID = @ProjectID)
FOR XML AUTO, ELEMENTS
RETURN 0
I think I'm close, but it was my best effort. Could someone help?
thanks in advanceHi TPolo,
Regarding your description, are you looking for a sample like below?
CREATE TABLE customer(customerID INT, name VARCHAR(99))
INSERT INTO customer VALUES(1,'Eric')
INSERT INTO customer VALUES(2,'Nelson')
CREATE TABLE orders(orderID INT,customerID INT)
INSERT INTO orders VALUES(1,1);
INSERT INTO orders VALUES(2,1)
INSERT INTO orders VALUES(3,2)
INSERT INTO orders VALUES(4,2)
CREATE TABLE orderDetails(orderID INT,item VARCHAR(99))
INSERT INTO orderDetails VALUES(1,'APPLE1')
INSERT INTO orderDetails VALUES(1,'BANANA1')
INSERT INTO orderDetails VALUES(2,'APPLE2')
INSERT INTO orderDetails VALUES(2,'BANANA2')
INSERT INTO orderDetails VALUES(3,'APPLE3')
INSERT INTO orderDetails VALUES(3,'BANANA3')
INSERT INTO orderDetails VALUES(4,'APPLE4')
INSERT INTO orderDetails VALUES(4,'BANANA5')
SELECT customer.customerID,customer.name,
(SELECT orderId,
SELECT item FROM orderDetails WHERE orderID=orders.orderID FOR XML AUTO,TYPE,ELEMENTS
FROM orders Where customerID=customer.customerID FOR XML AUTO,TYPE,ELEMENTS)
FROM customer WHERE customerID=1
FOR XML AUTO,ELEMENTS
DROP TABLE customer,orderDetails,orders
If you have any feedback on our support, please click
here.
Eric Zhang
TechNet Community Support -
Problem with saving Parent - Child View Objects in ADF 11g.
Hi Every one,
I have a requirment, something like I will be displaying some data on my jsff screen based on one Transient View Object. Whenever user clicks on Save button, I have to do following steps in my AMImpl.
-> Preapre dynamically Parent View Object Rows based on some logic
-> Prepare dynamically Child View object Rows and invoke insertRow method on respective child view object.
When I say commit() First Parent ViewObject data need to be saved and then Child View object data has to be saved. I am having Parent - Child Key relation ship btw these two ViewObjects. Some how I am populating the Parent Primary key in the Child View Object. Please suggest me If there is any other alternative to this.
ThanksI got the solution, Enabling the check box option for Master - Detail Entity association (CompositionAssociation -> Cascade Update Key Attributes) resolved the issue.
Thanks -
Does table STPOX contain parent-child relationship between components
Hello
I need to get a list of components of SO BOM.
FM CS_BOM_EXPL_KND_V1 exports an output table STPOX.
Does this table contain parent-child relationship between components? If yes , can somebody tell me which fields contain parent child id.
thanksHi,
STPOX is not a table, it is a structure & hence there is no storing of data in a structure. The table which stores this info is STPO.
To get the link you can refer to STPO-STLNR & pass this value to MAST-STLNR, this way you can link the child with its parent.
Regards,
Vivek -
How to allow Sharepoint users to login from multiple parent-child accounts?
Our client has mutliple AD domains and wants to allow people which have multiple AD accounts in multiple domains to login as THE SAME user:
- only primary account will be visible in search
- there will be only one user profile with all informations gathered from all sub accounts
- permissions for the sub account will be in sync with parent account
- task generated for parent will be visible for child accouns too etc
- ad admin can link the account together in the Active Directory - this link is permament (even if we move users to another OU) and ad admin can define which account is primary and secondary (parent/child)
How we can implement this in Sharepoint 2010 Std Server?Everything in SharePoint keys of the Security Identifier (SID) of a user. Each user in a domain has a unique SID, so there is no way to have multiple users recognized in SharePoint as the same user.
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem. -
Getting parent-child data from a single column in a table
Hi,
I have a parent-child data in a column.
Eg:
0
00
01
010
011
1
10
11
These values are present in the single column itself. My need is to get the parent values for the given child value.
For eg: If I am giving the input as 011, the query should return all its parents, i.e. 01 and 0
Could you please give me any inputs on this?
Thanks,
GVFrank Kulash wrote:
Assuming that each child's id is formed by adding exactly one character to the end of its parent's id:
SELECT id
FROM table_x
START WITH id = :target_id
CONNECT BY PRIOR id LIKE id || '_';
Small tweak to yours Frank if it's just the parents that need identifying...
SQL> ed
Wrote file afiedt.buf
1 with t as (select '0' as x from dual union all
2 select '00' from dual union all
3 select '01' from dual union all
4 select '010' from dual union all
5 select '011' from dual union all
6 select '1' from dual union all
7 select '10' from dual union all
8 select '11' from dual)
9 -- end of test data
10 SELECT x
11 FROM t, (select '&required' as req from dual) req
12 WHERE x != req.req
13 START WITH x = req.req
14* CONNECT BY PRIOR x LIKE x || '_'
SQL> /
Enter value for required: 011
old 11: FROM t, (select '&required' as req from dual) req
new 11: FROM t, (select '011' as req from dual) req
X
01
0
SQL> /
Enter value for required: 11
old 11: FROM t, (select '&required' as req from dual) req
new 11: FROM t, (select '11' as req from dual) req
X
1
SQL> -
No data for Parent-child hierarchy column in Pivot table view
Hi all,
I used OBIEE 11.1.1.6.2 Version.
I drag one Parent-child hierarchy column and one measure and show result with a pivot table view.
But when I click "+" icon to show detail level data,
It messaged that: "*the layout of this view combined with the data,selections,drills,or prompt values chosen resulted in no data*."
But it can show every-level data when I used table view.
It was so strange..
Did anybody meet this before?
Thanks in advance.
regards,
AnneHi,
Yes, I have the same problem with pivot table for hierarchy dimension.
If you use a normal table (not pivot) it seem to work. Unfortunatley with restrictions as normal table view have.
Same problem still exist in 11.1.1.6.5
I have logged a SR to Oracle about this. -
Parent Child Hierarchy Issue in OBIEE 11g
Hi All,
I am in OBIEE 11G v6. I have a sales fact table where the grain is one sale. So I have one row for every sale done.
Now I have a ragged employee hierarchy like this with David at the root node.
David >>Richard>>Sean
David >>James
Also, I have a role dimension which gives me what role each employee has performed on a sale. Only one employee can be associated with one sale. This is the way Roles have been asssigned
David = Manager
Richard = Off1
Sean = Off2
James = Off2
Both Sean and James can have same Roles. Now I have created a parent child hierarchy for my employee dimension and the closure table. Defined the member key, ancestor key relationship in the parent child setting etc.
Now in the report when I pull the parent child hierarchy and the sales_amount in the report, it comes out perfect with all the ragged hierarchy resolved. But the issue comes when I try to limit the report on Role = Off2. It gives me an error saying " The layout of this view combined with the data, selection , drills resulted in no data. Undo drill and view prompt values". Basically what i want is to be able to select any role type and then my hierarchy should be adjusted to show me that data. Like when I select Off2, I want to see David at the Top level and Sean and James under him because they are both Off 2 and David is their manager.
Is that possbile? Also, am I getting this error because when I select Off2 though it gets Sean and James but since David is not Off2, I don't get the data?
I hope I was able to explain the issue, any help on this would be greatly appreciated.
Thanks
RonnySo basically this means that if I build a parent child hierarchy on table A having the stucture like
--David (Manager)
-----James (Off1)
--------Bill (Off2)
and in my sales fact table for let's say today, I have only rows for Bill (Off2) because he is the only officer who did the sales today. Now when I will join my fact table to parent child hierarchy table A I will NOT get any data ? because there is no James who is the parent of Bill. So obiee need to have parent pulled off in the data (ANCESTOR) to be able to roll up the child.(IS_LEAF = 1)
I testes this and if my data only contains only rows for Bill (or I limit on ROLE = Off2) then it won't show the hierarchy. The query which OBIEE fires is to look for either ANCESTOR_KEY = NULL OR (DISTANCE = 1 AND ANCESTOR KEY IN (Bill). Therefore it doesn't I am wondering then what is the use of builiding the parent child hierarchy when we need to pull in all the ancestors (like in this case James for bill and David for james) because in real scenarios there can be cases wherein we would want to filter the data based on other dimensions to which the parent child hierarchy joins ? -
OBIEE 11g - Navigation in Parent Child Hiearchy not working
Hi All,
I have a employee parent child hierarchy and I want to show revenue for each employee in the report. I have modeled my revenue as a measure like case 4 shown in the following link
http://www.rittmanmead.com/2010/11/oracle-bi-ee-11g-parent-child-hierarchies-multiple-modeling-methods/
So for example this is my report ,
--David (30)
---Sandra (15)
-----Joe (10)
Joe'e revenue is 10, Sandra's is 5 (showing her 5 Joe's revenue) and David's is 5 (showing his 5 Sandra's revenue)
Issue :
Now what I want is to provide action link on the revenue column so that when user would click on revenue for any employee it would direct them to a detail report showing the bifurcation.
For ex, I want that when user click on 15 which is Sandra's revenue, he would be redirected to a detailed report for Sandra and similary for Joe and David
MY ISSUE IS that the navigation is NOT working for sandra and Joe. It is only working for David (who is the ancestor of sandra and Joe). When I click on 15 to see sandra's detail report, it doesn't do anything and in the bottom left corner of the browser status bar below I see an ERROR saying
(same for Joe but David work's fine)
Message: 'getLevelInfo(...)' is null or not an object
Line: 1
Char: 11142
Code: 0
URI: http://localhost:7001/analytics/res/b_mozilla/answers/selectionsmodel.js
Why is that happening? Is that because I have modeled the revenue as an measure and not attribute. Is navigation not possible in this case?
Anybody has any solution or workaround for this, it will be highly appreciated.
Thanks,
RonnyOk, so let me explain this in detail and give the structure of my tables and the data,
There are three tables.
1.Parent Child relationship table - pctable
2.Closure table which OBIEE creates through a script - reltable
3.Fact table which contains the revenue - facttable
This is the data
pctable
personid | managerid
David | NULL
Sandra| David
Joe|Sandra
reltable
memberkey | ancestorkey |distance |is_leaf
David|NULL|NULL|0
David|David|0|0
Sandra|Sandra|0|0
Joe|Joe|0|0
Sandra|David|1|0
Joe|Sandra|1|1
Joe|David|2|1
facttable
personid|revenue
David|5
Sandra|5
Joe|10
and my joins conditions are, I join pctable to reltable and then reltable is joined to facttable like this.
pctable.personid = reltable.ancestorkey
reltable.memberkey = facttable.personid
and then in the report, when I pull up the pchierarchy build from pctable and revenue , I get as below and like I said, when I click on Sandra to see the revenue she contributes, I am not able to navigate. Can you let me know what modifications needs to be done?
---David(20)
----Sandra(15)
------Joe(10) -
How to update a parent child hierarchy in OBIEE
Hello All
Quick question about updating parent child hierarchy in OBIEE.
As we know, OBIEE 11G allows us to create value based hierarchy by generating table creation script and insert script. In the typical example of employee dimension, the parent child relationship table will be created with the following 4 attributes:
MEMBER_KEY, ANCESTOR_KEY, DISTANCE, IS_LEAF
So, what if later in the years some of the employees got promoted, retired or transferred? The value based hierarchy is going to change because person 1 reports to manager 2 now instead of 1. Obviously, the records in employee dimension is going to be updated. When that happens, how to update the parent child relation table with the same information? Do we have to rerun the insert script? How do we keep the history of employee changes and hierarchy changes?
Please advice
Thank youI guess it will update when the structure changes,Let see the response from other gurus.
Thanks, -
Insert Record with Parent/Child Tables doesn't work with Oracle - unlike AC
Hi,
I just Migrated a MS Access 2010 Database to an Oracle 11g Backend with the SQL Developer Tool.
The Migration went fine, all the Tables and Views are migrated.
I'm working with MS Access as Frontend.
The application has some Datasheets with Subdatasheets with Parent/Child Relationship. (1-n Relationship)
After changing to Oracle, it's not possible, to Insert a new Record in a Subdatasheet I always get the following Error Message:
"The Microsoft Access database engine cannot find a record in the table 'xxxx' with key matching field(s) 'zzzzz'"
It used to work perfect with the MS Access Backend, do I need a trigger which first adds the child Record ?
Or what should I do?
Thank youHi Klaus,
Thanks for your answer. I still haven't solved my problem. The only way would be to use a singel 1:n Relationship, but in fact I need a n:m Relationship.
I tried the same scenario with a new Access Application, same result.
To clearify my problem.
Goal: Parent Form with Parent Records, Linked Child Form with Child Records in a Datasheet View => Insert of a NEW Child Record.
I have 3 Tables (table1 = Parent tabel, table2 = Child Table, table12 = n:m Tabel with PK and two FK)
The Recordsource of the Parent Form is Tabel1
The Recordsource of the Child Form is Table2 joined with Table12.
In my Old Access Project, Access Triggered the Insert and filled Table12 with the NEW PK of Table2.
It seems like Access can't do that anymore....
I'm pretty desperate and I'm sure it is just a litte thing to fix..... -
How to Differentiate between Parent & child item of material determination
Hi Experts
I have a list of material & the Business requirement is to found that whether a material is a Parent material , Child material or Both ( a parent to other children and a child to another parent).
I tried using table KONDD & KONDDP but I was not able to differeniate between Parent & Child item.
I even cant use item category to diferentaite the two as by item categairy i can only find that it is a Prent material but cant find whether this material is a Child material or not.
Is there any table in which i can enter the Parent material & the output would be child material or any other table which contain both parent & child material.
Note : In Material determination ( VB11) , the material which is entered is Parent material & the material with which it would be replaced is Child material.
Kindly Guide.
Thanks in AdvanceHi
The wording of Parent and Child sounds like using a BOM material. In material determination...these two items can be called as Material entered and material determined or Main Item and Sub Item.
In the sales order overview screen...at line item level check the field 'HLvItem' (Higher Level Item). It will show the POSNR of the main item to which this item is linked. Since this can also happen in the case of free goods and BOM...you have make another check for these items with the item category.
If the substitue material is not determined as a sub item... you can check the material number in the field 'Material Entered' in the sales tab of the item and compare the material number with that exists in the VBAP-MATNR. If both are different, then this material can be considered as a determined material.
Thanks,
Ravi -
Help needed in retrieving parent child relationship values
Hi,
I have a requirement to get parent child relationship values as below.
Ex: Address table
cont cont_code state state_code
C1 10 S1 1
C1 10 S2 2
C1 10 S3 3
C2 20 S4 4
C2 20 S5 5
C3 30 S6 6
C3 30 S7 7
C3 30 S8 8
I want a result of country/state and corresponding code like below.
corresponding states should be displayed under each country with some space appended to it.
Geography code
C1 10
S1 1
S2 2
S3 3
C2 20
S4 4
S5 5
C3 30
S6 6
S7 7
S8 8
I am using oracle 10g version.
Thanks in advance.Hi,
When you post formatted text (like your output) on this site, type these 6 characters:
\(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
I think you're saying that you want this output:GEOGRAPHY CODE
C1 10
S1 1
S2 2
S3 3
C2 20
S4 4
S5 5
C3 30
S6 6
S7 7
S8 8
If so, UNION, as Hoek suggested, is a good way.
GROUP BY ROLLUP is more efficient, but harder to understand:SELECT CASE
WHEN GROUPING (state) = 1
THEN cont
ELSE ' ' || state
END AS geography
, CASE
WHEN GROUPING (state) = 1
THEN MAX (cont_code)
ELSE MAX (state_code)
END AS code
FROM t
GROUP BY cont
, ROLLUP (state)
ORDER BY cont
, state NULLS FIRST
By the way, this looks like a bad table design.
In a relational database, the fact that the name 'C1' belongs to cont_code 10 should only be stored in one place. You have the same information on 3 separate rows.
Also, if 'C1' and 'S1' are both names, they should probably be in the same column, so that (to give just one example) you can find the information about 'x1' without knowing if it is a cont or a state.
A better design would be.NAME CODE PARENT DSCR
==== ==== ====== ====
C1 10 CONT
S1 1 10 STATE
S2 2 10 STATE
S3 3 10 STATE
C2 20 CONT
S4 4 20 STATE
S5 5 20 STATE
C3 30 CONT
S6 6 30 STATE
S7 7 30 STATE
S8 8 30 STATE
If the data is this simple, then the dscr column isn't needed. Whether parent is NULL or not tells whether the rows represents a cont or a state.
To get the results you want from a table like this, you could use CONNECT BY. Using either UNION or ROLLUP, you have to know, at the time you write the query, how many levels there will be in the parent-child tree, and the length of the code is proportional to that depth, and the table has to be changed if you ever need to add another level. CONNECT BY can handle any number of levels, and the length and complexity of the code is the same whether you have just 2 levels (countries and strates), or 7 levels (continents, regions, countiries, states, districts, cities and neighborhoods) or 72 levels. The table doesn't need any more columns, no matter how deep the tree gets.
Edited by: Frank Kulash on Sep 16, 2010 11:54 AM
Maybe you are looking for
-
OT: U.S. Midwest flood relief project needs volunteers
Greetings everybody, I discovered this organization recently, Hands On Disaster Response http://www.hodr.org). They provide opportunities for short-term volunteer work in disaster locations, with what appears to be very little red tape. I haven't bee
-
Premiere Pro CC 2014.1 has stopped working
Here is the message I receive: Problem Event Name: APPCRASH Application Name: Adobe Premiere Pro.exe Application Version: 8.1.0.81 Application Timestamp: 5426694c Fault Module Name: MXF_SDK_4.4.33_vs10.dll Fault Module Version: 4.4.33.0
-
Burning project with Toast, not built in burn utility
okay so here's the sitch. got the project finished. but iDVD won't burn it or let me save an image cause it's like .2GB over the disc space for an SL disc and I don't have a DL burner. It just says 'remove content' but theres' nothing I can remove. T
-
Hello guys say that I took an export of a schema from database 10G and import it into a 11G database and now I would like to upgrade that schema, Can some one point me to the oracle docs that explains this process. When i google "oracle schema upgrad
-
Cannot open cmc sap authentication - role and alias update failing
I have two business objects environments. For two of them I am failing to login to a specific part of CMC. I want to go to Authentication tab, SAP authentication. The page is not opening. I have on both environments 500.000 + Failed jobs. (settings