How to achieve parent-child relationship using self join?
my table structure is as follows
parent child name
-1 1 A1
1 2 A2
1 3 A3
how to achieve the hierarchy model using self join. this can be easily achieved using "connect by prior". but how to achieve the same using self join?
Hi,
Yes, that's definitely possible. If you only need to display two levels from the hierarchy, a self-join is a good option. Make it an outer join if you need to show everyone on one level, regardless of whether they have a match on the other level or not; for example, if you want the output:
child_name child_id parent_name parent_id
A1 1
A2 2 A1 1
A3 3 A1 1It's good that you posted some sample data. Now post the results you want from that data, and your query (what you think is the best attempt you've made so far). If you haven't tried anything so far, then look at some other simple self-join to get ideas.
Similar Messages
-
How to output the outline parent-child relationship using a report script?
I'd like to extract the outline's dimension members with it's parent-child relationship using a report script. Anybody can provide a sample script? Thanks.
Example:
DimensionX
-----MemberX
----------ChildX
Output:
Dimension X MemberX
MemberX ChildX
Edited by: obelisk on Jan 11, 2010 5:16 PMSorry a report script won't do it. You have two options
1. Use at Essbase Outline API to walk the outline and get it for you
2. Use the Outline extractor available from Applied Olap (it is a free download). It can be run interactively of as a bat file.
Frankly, I would rather use 2 since I don't have to code it myself -
Implement Parent child Relationship using SSIS
Could you please suggest the best way which should not impact the performance of data loading, to implement parent child relationship using SSIS.
We have a flat file RECON80.dat which need to be loaded into the database into 2 tables.
Parent Table JobMaster and Child Table RECON80 .
In the flat file we have a fields Jobphase which will get inserted in JobMaster table and the remaning details like EIN, DATE etc will get inserted in RECON80 table.
The Parent table JobMaster has JobId as an identity column which is the Pk of the table and it will get inserted into the child table i.e RECON80 JobId as FK of the child tale.
Please suggest the best possible way to achieve it.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. -
How to create Parent Child relationship of Assets
Hi All
can any one provide the solution for the below mention requirment.
Problem Description: How to create Parent Child relationship of Assets in below case.
1. If asset Category of Child assets are different but both parent & child assets are already capitalized.
2. If asset Category of Child assets are same but both parent & child assets are already capitalized.
3. If asset Category of Child assets are same for new assets.Hi All
can any one provide the solution for the below mention requirment.
Problem Description: How to create Parent Child relationship of Assets in below case.
1. If asset Category of Child assets are different but both parent & child assets are already capitalized.
2. If asset Category of Child assets are same but both parent & child assets are already capitalized.
3. If asset Category of Child assets are same for new assets. -
How to model parent child relationship with DPL? @Transient?
Hello All,
I want to model a parent entity object with a collection of child entities:
@Entity
public class Parent{
@PrimaryKey
String uuid;
List<Child> children;
@Entity
public class Child{
@PrimaryKey
String id;
I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
Thanks in advance,
Steven
Harvard Children's Hospital Informatics Program
Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PMHi Steven,
The definition of persistence is here:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
I suggest looking at this javadoc:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
--mark -
How to achieve parent - child record insert in forms
Guys,
I am new to forms. I do have a requirement where I need to create one tabular block for 10 rows (parent record) and then I need to create three tabular tabs of 5 rows for detailed records (child). That means each tab can have 5 records for 1 parent row.. Thats how this parent-child structure has ONE to MANY relationships
To achieve this requirement I created one parent block of table type (using table XX_Parent) and then I created three detailed block for each tab (Tab_A,Tab_B,Tab_C) using child table (XX_Child). For each tab while inserting the data I took one context_value column in child table. i.e. when I insert the data using Tab_A , context_value column will be A. In the same way B and C for Tab_B for Tab_C respectively. And I wrote this logic at PRE-INSERT trigger for each tab. But when I insert the data for all the tabs, it allows me to enter successfully for Tab_A only, the moment I navigate from Tab_A to enter the data intoTab_B, it throws me error like "You are passing NULL value to set context_value". I hope I make the requirement clear to you.
I am not sure if I am following the right approach to achieve my requirement. if its not right, please suggest me right one.. and if its right please guide me resolve the error..
Looking forward to your reply.
Thanks
SunilAndreas,
I had already created relations between Matster Block -Tab_A block, Master Block -Tab_B block and Master Block - Tab_C block...
The point is all the three tabs are created using one table XX_Child only.. I used context_value A,B and C respectively so that once I query the data for XX_Child from backend, I should be in a position to figure out what data is inserted using Tab A, B and C. why I need so .. because If take my entire form in query mode and search for a master record.. then Tab_A, tab_B and Tab_C display their respective data. I hope, I make you understand.. Can you please guide me.
Thanks
Sunil -
Fetching parent-child relationship using API or XSD parsing?
Hi,
I would like to fetch all children of a parent object. I did not see any API to provide this information. I tried with GetMapping API, however it does not provide list of all child objects.
E.g. Fetching all child of "Account" object should return all child objects {Activity, Address, Asset, Attachment, Business Plan, Claim, Deal Registration, Financial Account, Financial Account Holder, Financial Plan, Lead, Message Response, Note, Objective, Opportunity, Policy, Policy Holder, Revenue, Service Request, Special Pricing Request}
Is it possible through API? If not, then XSD parsing seems to be the only way to retrieve children. Any guideline or rule on XSD parsing to get list of all children. XSD parsing doesn't look a good solution. Any other way to do so?
This information is crucial for us. Please provide input.
Thanks
Ravish833189 wrote:
Hi,
I would like to fetch all children of a parent object. I did not see any API to provide this information. I tried with GetMapping API, however it does not provide list of all child objects.
E.g. Fetching all child of "Account" object should return all child objects {Activity, Address, Asset, Attachment, Business Plan, Claim, Deal Registration, Financial Account, Financial Account Holder, Financial Plan, Lead, Message Response, Note, Objective, Opportunity, Policy, Policy Holder, Revenue, Service Request, Special Pricing Request}
Is it possible through API? If not, then XSD parsing seems to be the only way to retrieve children. Any guideline or rule on XSD parsing to get list of all children. XSD parsing doesn't look a good solution. Any other way to do so?
This information is crucial for us. Please provide input.
Thanks
RavishHi Ravish,
Any success on this one? We are hurdling the same difficulty as of the moment. We are basically building a plugin that will remotely (and automatically) import a CRMOD object's data model. That goes to say also that we're relying on CRMOD's web services for our solution.
I've read from the Web Services on Demand Guide that GetMapping is suppose to "Return the display names and XML tags of the fields of a record type *or one of its child components*..."+. It seems that this translates to - if you want the list of fields for a child component, you have to run GetMapping on the child component. If this is the case, what other available web services calls can we make to get the relationship hierarchy of a CRMOD object? Any help would be greatly appreciated.:-)
Thank you,
John -
How to know 'parent-child relationship' of equipments
Hello experts,
I am currently having a problem here. How can I know if a certain equipment has a child/subordinate equipemt under it? for example, I typed in the value 000000345534 for the 'ILOAN' field in EQUZ table to get it's EQUNR and HEQUI. Now, where can I know if it has a child equipment under it? for example:
12610 (highest primary)
12611
12612 (subordinate and primary)
12613
Also, I have to display it in the report output like this:
ASSET PARENT DESCRIPTION LOCATION NETBOOK VALUEHi,
I had developed a code wherein I had a similar scenario.Please refer the same. Will give you an idea.
FORM link.
SKIP 2.
ULINE.
WRITE : / 'Link b/w Transform No and Conn. No' COLOR 6
INTENSIFIED ON.
ULINE.
TABLES:
iflo.
INCLUDE <line>.
**Data type declaration
DATA: BEGIN OF h_iflo_sel OCCURS 0,
tplnr LIKE iflo-tplnr.
DATA: END OF h_iflo_sel.
DATA : i_iloa1 LIKE TABLE OF iloa WITH HEADER LINE,
i_iloa2 LIKE TABLE OF iloa WITH HEADER LINE.
DATA : BEGIN OF t_inet,
kante LIKE inet-kante,
eqnach LIKE inet-eqnach,
END OF t_inet.
DATA: BEGIN OF h_iflo_tab OCCURS 0.
INCLUDE STRUCTURE iflo.
DATA: END OF h_iflo_tab.
*For Final Display.
DATA : BEGIN OF i_final OCCURS 0,
data(30) TYPE c,
desc(40) TYPE c,
END OF i_final.
DATA : BEGIN OF i_finalitab OCCURS 0,
eqvon LIKE inet-eqvon,
eqnach LIKE inet-eqnach,
eqtyp LIKE equi-eqtyp,
eqktx LIKE eqkt-eqktx,
tplnr LIKE iflo-tplnr,
pltxt LIKE iflo-pltxt,
kunum LIKE zconnection-kunum,
END OF i_finalitab.
DATA : BEGIN OF i_eqkt OCCURS 0.
INCLUDE STRUCTURE eqkt.
DATA : END OF i_eqkt.
DATA : i_iflo LIKE TABLE OF iflo WITH HEADER LINE,
i_zconn LIKE TABLE OF zconnection WITH HEADER LINE,
i_kna1 LIKE TABLE OF kna1 WITH HEADER LINE,
i_equi LIKE TABLE OF equi WITH HEADER LINE,
i_inet LIKE TABLE OF inet WITH HEADER LINE.
DATA : var TYPE i VALUE 2,
count TYPE i VALUE 0,
tempcount TYPE i VALUE 0,
lv_index LIKE sy-tabix,
flag(5) TYPE c VALUE 'ODD' .
DATA : kante LIKE inet-kante,
eqvon LIKE inet-eqvon,
eqnach LIKE inet-eqnach.
DATA: equnr LIKE zconnection-equnr.
*Fetching the transformer no and the Connection no
SELECT a~kante a~eqvon a~eqnach
INTO CORRESPONDING FIELDS OF TABLE i_inet
FROM ( inet AS a
INNER JOIN zconnection AS b ON a~eqnach = b~equnr )
WHERE a~eqvon = dy_equnr.
LOOP AT i_inet.
MOVE i_inet-eqvon TO i_finalitab-eqvon.
MOVE i_inet-eqnach TO i_finalitab-eqnach.
APPEND i_finalitab.
ENDLOOP.
LOOP AT i_finalitab.
*Fetching the Functional Location for Connection number
CALL FUNCTION 'EQUIPMENT_READ'
EXPORTING
equi_no = i_finalitab-eqnach
IMPORTING
eqkt = i_eqkt
iloa = i_iloa1.
MOVE i_iloa1-tplnr TO i_finalitab-tplnr.
MOVE i_eqkt-eqktx TO i_finalitab-eqktx.
MODIFY i_finalitab.
ENDLOOP.
* Fetching desc of func location of conn no
SELECT * FROM iflo
INTO TABLE i_iflo
FOR ALL ENTRIES IN i_finalitab
WHERE tplnr = i_finalitab-tplnr.
LOOP AT i_finalitab.
READ TABLE i_iflo WITH KEY tplnr = i_finalitab-tplnr.
IF sy-subrc = 0 .
MOVE i_iflo-pltxt TO i_finalitab-pltxt.
MODIFY i_finalitab.
ENDIF.
ENDLOOP.
* Fetching the customer no's for each connection no in Z table
SELECT * FROM zconnection
INTO TABLE i_zconn
FOR ALL ENTRIES IN i_finalitab
WHERE equnr = i_finalitab-eqnach.
LOOP AT i_finalitab.
lv_index = lv_index + 1.
READ TABLE i_zconn WITH KEY equnr = i_finalitab-eqnach.
IF sy-subrc = 0.
MOVE i_zconn-kunum TO i_finalitab-kunum.
MODIFY i_finalitab.
ENDIF.
ENDLOOP.
*Fetching the equipment category for each conn no
SELECT * FROM equi
INTO TABLE i_equi
FOR ALL ENTRIES IN i_finalitab
WHERE equnr = i_finalitab-eqnach.
LOOP AT i_finalitab.
READ TABLE i_equi WITH KEY equnr = i_finalitab-eqnach.
IF sy-subrc = 0.
MOVE i_equi-eqtyp TO i_finalitab-eqtyp.
MODIFY i_finalitab.
ENDIF.
ENDLOOP.
*Fetching the Functional Location for Transformer number
CALL FUNCTION 'EQUIPMENT_READ'
EXPORTING
equi_no = dy_equnr
IMPORTING
eqkt = i_eqkt
iloa = i_iloa2.
*For Fetching the description of the func loc. of Transformer Number
REFRESH i_iflo.
SELECT SINGLE * FROM iflo
INTO i_iflo
WHERE tplnr = i_iloa2-tplnr.
*Moving into the final internal table .
MOVE dy_equnr TO i_final-data.
MOVE i_eqkt-eqktx TO i_final-desc.
APPEND i_final.
MOVE i_iloa2-tplnr TO i_final-data.
MOVE i_iflo-pltxt TO i_final-desc.
APPEND i_final.
*For finding the superior functional location.
REFRESH h_iflo_sel.
MOVE i_iloa2-tplnr TO h_iflo_sel-tplnr.
APPEND h_iflo_sel.
*Finding the Superior Func. Location until it reaches the top.
h_iflo_tab-tplma = '1'.
DO 100 TIMES.
IF h_iflo_tab-tplma <> ' '.
REFRESH h_iflo_tab.
CALL FUNCTION 'FUNC_LOCATION_ARRAY'
EXPORTING
selfield = 'TPLNR'
spras = sy-langu
tabstructure = 'IFLO'
TABLES
iflo_sel = h_iflo_sel
iflo_tab = h_iflo_tab.
IF h_iflo_tab-tplma <> ' '.
*To find the above func .location
REFRESH h_iflo_sel.
MOVE h_iflo_tab-tplma TO h_iflo_sel-tplnr.
APPEND h_iflo_sel.
*For Fetching the description of the func loc. of Transformer Number
REFRESH i_iflo.
SELECT SINGLE * FROM iflo
INTO i_iflo
WHERE tplnr = h_iflo_tab-tplma.
*Moving the values into the final internal table
MOVE h_iflo_tab-tplma TO i_final-data.
MOVE i_iflo-pltxt TO i_final-desc.
APPEND i_final.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
*Displaying in a tree structure
IF NOT i_final[] IS INITIAL.
DESCRIBE TABLE i_final LINES count.
tempcount = count.
DO tempcount TIMES.
READ TABLE i_final INDEX count.
count = count - 1.
WRITE: i_final-data COLOR 4 INTENSIFIED ON.
WRITE: i_final-desc.
IF count <> 0.
WRITE:/var sy-vline NO-GAP.
ULINE :/var(8).
var = var + 9.
ENDIF.
ENDDO.
ENDIF.
SKIP.
* Displaying the Customer no's.
WRITE : /'Transformer no'COLOR 7 INTENSIFIED ON,18(18)
'Connection no'COLOR 7 INTENSIFIED ON,37(3)'Cat'COLOR 7
INTENSIFIED ON,41(40)'Connection desc'COLOR 7 INTENSIFIED ON,
81(42) 'Connection Object'COLOR 7 INTENSIFIED ON,123(40)
'Conn Obj Desc'COLOR 7 INTENSIFIED ON,
163(10)'Customer'COLOR 7 INTENSIFIED ON.
IF NOT i_finalitab[] IS INITIAL.
DESCRIBE TABLE i_finalitab LINES count.
tempcount = count.
DO tempcount TIMES.
READ TABLE i_finalitab INDEX count.
count = count - 1.
SKIP.
WRITE: / i_finalitab-eqvon COLOR 4 INTENSIFIED ON, i_finalitab-eqnach
COLOR 5 INTENSIFIED ON,i_finalitab-eqtyp COLOR 4 INTENSIFIED
ON, i_finalitab-eqktx, i_finalitab-tplnr
,i_finalitab-pltxt
,i_finalitab-kunum.
ENDDO.
ENDIF.
ENDFORM.
Regards,
Gayathri -
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 AMHi 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. -
Import of parent/child relationships
Hi,
While importing the parent/child relationship using Import Manager,i selected the Relationship in the Destination table.After mapping the corresponding fields,alll the fields under Match Records tab are greyed out.How do i import the parent/child relationships?
Thanks and Regards,
PreethiHi Preethi,
Check the configuration options related to Relationships. In addition check the below link
http://help.sap.com/saphelp_mdm550/helpdata/en/43/12036df94c3e92e10000000a1553f6/frameset.htm
Importing Parent/Child Relationship Links
Regards,
Jitesh Talreja
Edited by: Jitesh Talreja on May 5, 2009 4:17 PM -
How to use GL Parent Child relationships in Discoverer?
Subject: How to used GL Parent Child relationships in Discoverer?
How to use GL Parent Child relationships in Discoverer?
Please let me know how to incorporate the parent -child relation ships exsiting in GL Accouting flexfield Segments in Discoverer for drill downs? we have GL - BIS views installed.
How to create the specific Parent -child relationship hierarchies in Discoverer from the FND_* tables?
Please help.
Thanks.
KS.Hi,
I'm also trying to implement this. If you have come any further in solving this any hints would be much appreciated...
regards,
AJ -
Function to get the path using a parent-child relationship
Hello,
I have a table which uses parent-child relationship to store the options available. I need a function to give me the full path given the id of a particular option.
I have two different functions. One of them uses the Oracle built in function and the other uses simple queries with a loop.The code of the functions are given below.
Now, the problem is with their "performance". The difference in their performance is significant. The function using the Oracle function takes more than 2 hours to run a query whereas the other function takes less than 2 minutes.
I am having trouble trusting the other function. No matter how many tests I perform on the output of both the functions, it always comes out to be the same.
Any thoughts to help me understand this ??
Function 1
=====================
FUNCTION Gettree (opt_id IN NUMBER,i_app_id IN NUMBER)
RETURN VARCHAR2
IS
path VARCHAR2(32767);
application_no NUMBER;
BEGIN
SELECT ABC.APP_OPT_ID INTO application_no FROM ABC
WHERE ABC.APP_ID = i_app_id AND ABC.PARENT_ID IS NULL;
SELECT LPAD(' ', 2*LEVEL-1)||SYS_CONNECT_BY_PATH(app_opt_name, '=>') "Path" INTO path
FROM ABC
WHERE app_opt_id = opt_id
START WITH parent_id =application_no
CONNECT BY PRIOR app_opt_id =parent_id;
path := SUBSTR(path,INSTR(path,'>')+1,LENGTH(path));
RETURN path;
END Gettree ;
Function 2
======================
FUNCTION GetOptPath(opt_id NUMBER,app_id NUMBER)
RETURN VARCHAR2
IS
string VARCHAR2(900);
opt VARCHAR2(100);
pid NUMBER(38);
BEGIN
SELECT ABC.parent_id,ABC.app_opt_name INTO pid,string FROM ABC WHERE ABC.app_opt_id = opt_id;
IF pid IS NULL
THEN
RETURN 'root';
ELSIF pid IS NOT NULL
THEN
LOOP
SELECT ABC.app_opt_name,ABC.parent_id INTO opt, pid FROM ABC WHERE ABC.app_opt_id = pid;
EXIT WHEN pid IS NULL;
string := opt || '=>'|| string;
END LOOP;
RETURN string;
END IF;
END;Hi,
user8653480 wrote:
Hello Frank,
The parameters taken by gettree & getoptpath are app_opt_id and app_id and both the functions return only one string i.e. the path of that particular option (app_opt_id) starting from its root and not all the descendants of that option/root node of that option.
So, does that mean that gettree first fetches all the descendants of the root node of the given option and then returns the required one ??Yes. It's a little like the situation where you need to meet with your co-worker Amy, so you send an e-mail to everyone in the department telling them to come to your office, and then, when they arrive, tell everyone except Amy that they can leave.
>
And if that is the case, then won't it be better to use the bottom-up approach to fetch the required path just for that particular option ?? 'coz my requirement is that only.. given an option_id get the full path starting from the root.Exactly!
I have used explain plan also for both the functions.. but since I did not know how to anlayze the output from plan_table so I just compared the value in the fields and they were exactly the same for both the queries.If you'd like help analyzing the plans, post them, as Centinul said.
I am attaching a sample data with the outputs of both the functions for the reference.
(tried attaching the file but could not find the option, so pasting the data here)
App_opt_ID App_ID Parent_ID App_opt_name "gettree(app_opt_id,app_id)" "getoptpath(app_opt_id,app_id)"
1 1 NULL application NULL root
2 1 1 module1 module1 module1
3 1 1 module2 module2 module2
4 1 2 submod1 module1=>submod1 module1=>submod1
5 1 3 submod1 module2=>submod1 module2=>submod1
6 1 5 opt1 module2=>submod1=>opt1 module2=>submod1=>opt1
7 2 NULL app2 NULL root
8 2 7 scr1 scr1 scr1
9 2 8 opt1 scr1=>opt1 scr1=>opt1
10 2 7 scr2 scr2 scr2Please help.The best solution is to do a bottom-up query, and write a function like reverse_path (described in my first message) to manipulate the string returned by SYS_CONNECT_BY_PATH. You seem to have all the PL/SQL skills needed for this.
Another approach is a revised form of gettree, like I posted earlier. Does it do what you want or not?
If you'd help, then post a little sample data in a form people can actually use, such as CREATE TABLE and INSERT statements. Post a few sets of parameters, and the results you need from each set, given the sample data posted. -
How do I identify parent/child relationship
How do I identify parent/child relationship in Designer?
turn your object into a symbol, and place multiple instances of it on the artboard, when you edit the symbol all instances will update.
-
Re: Circular Parent-Child relationship amongwidgets.
Alaiah,
Setting the parent to NIL is the proper thing to do to remove
a widget from a panel. Why don't you try just setting it
to NIL and not adding the new chart to the window to make
sure that it gets removed. If that doesn't work, maybe
Window.UpdateDisplay, but you shouldn't have to do that.
As far as the parent-child relationship issue, when you set
the widget's Parent to NIL, that is actually invoking a virtual
attribute that does more than just NIL out the reference. One
of the things that happens is that the child is removed from
the parent's Children array. Do a task.lgr.putline(<parent>.Children.Items)
to see how many items are in the array, then do the NIL, then
do a second putline and you'll see the array has one less item.
Bobby
At 06:10 PM 12/19/96 PST, Chandrashekar, Alaiah wrote:
>
I am trying to draw a Bar Graph on a panel which in turn sits on the main
window. The height policy of the panel widget is set to SP_TO_PARENT so that
when the window is resized the panel is also resized according to the parent
window. I have a situation that every time the panel is resized I need to
scale the Bar Graph in accordance with the new panel size and draw it. But
before drawing the newly scaled Bar Graph I am clearing out all the children
of the panel ( I am doing this just to refresh the panel) and then drawing
the newly scaled Bar Graph. But this does not work!!! I still find some
left over from the previous Bar Graph!!! Any help in this matter is greatly
appreciated.
Also I don't understand this circular parent-child relationship. If I assign
a NIL to Parent attribute of all the children of the panel, what will happen
to the Children attribute of the panel? Won't there be any memory leak by
adopting the above procedure of disconnecting a child from its parent? If
so, how do we take care of it?
Thanks in advance!
Alaiah Chandrashekar
The following is the segment of the code which could be useful for clarity:
// Draws the Bar Graph for the first time.
self.ShowChart(TestData);
self.Open();
event loop
when task.Shutdown do
exit;
// When the window is resized
// I am scaling the Bar Graph for the new
// panel size.
when self.window.AfterReSize do
self.ClearChartPanel();
// self.window.UpdateDisplay();
self.ShowChart(TestData);
end event;
self.Close();
Method ClearChartPanel is as follows:
for child in self.<ChartPanel>.Children do
child.Parent = NIL;
end for;Alaiah,
Setting the parent to NIL is the proper thing to do to remove
a widget from a panel. Why don't you try just setting it
to NIL and not adding the new chart to the window to make
sure that it gets removed. If that doesn't work, maybe
Window.UpdateDisplay, but you shouldn't have to do that.
As far as the parent-child relationship issue, when you set
the widget's Parent to NIL, that is actually invoking a virtual
attribute that does more than just NIL out the reference. One
of the things that happens is that the child is removed from
the parent's Children array. Do a task.lgr.putline(<parent>.Children.Items)
to see how many items are in the array, then do the NIL, then
do a second putline and you'll see the array has one less item.
Bobby
At 06:10 PM 12/19/96 PST, Chandrashekar, Alaiah wrote:
>
I am trying to draw a Bar Graph on a panel which in turn sits on the main
window. The height policy of the panel widget is set to SP_TO_PARENT so that
when the window is resized the panel is also resized according to the parent
window. I have a situation that every time the panel is resized I need to
scale the Bar Graph in accordance with the new panel size and draw it. But
before drawing the newly scaled Bar Graph I am clearing out all the children
of the panel ( I am doing this just to refresh the panel) and then drawing
the newly scaled Bar Graph. But this does not work!!! I still find some
left over from the previous Bar Graph!!! Any help in this matter is greatly
appreciated.
Also I don't understand this circular parent-child relationship. If I assign
a NIL to Parent attribute of all the children of the panel, what will happen
to the Children attribute of the panel? Won't there be any memory leak by
adopting the above procedure of disconnecting a child from its parent? If
so, how do we take care of it?
Thanks in advance!
Alaiah Chandrashekar
The following is the segment of the code which could be useful for clarity:
// Draws the Bar Graph for the first time.
self.ShowChart(TestData);
self.Open();
event loop
when task.Shutdown do
exit;
// When the window is resized
// I am scaling the Bar Graph for the new
// panel size.
when self.window.AfterReSize do
self.ClearChartPanel();
// self.window.UpdateDisplay();
self.ShowChart(TestData);
end event;
self.Close();
Method ClearChartPanel is as follows:
for child in self.<ChartPanel>.Children do
child.Parent = NIL;
end for; -
Circular Parent-Child relationship among widgets.
I am trying to draw a Bar Graph on a panel which in turn sits on the main
window. The height policy of the panel widget is set to SP_TO_PARENT so that
when the window is resized the panel is also resized according to the parent
window. I have a situation that every time the panel is resized I need to
scale the Bar Graph in accordance with the new panel size and draw it. But
before drawing the newly scaled Bar Graph I am clearing out all the children
of the panel ( I am doing this just to refresh the panel) and then drawing
the newly scaled Bar Graph. But this does not work!!! I still find some
left over from the previous Bar Graph!!! Any help in this matter is greatly
appreciated.
Also I don't understand this circular parent-child relationship. If I assign
a NIL to Parent attribute of all the children of the panel, what will happen
to the Children attribute of the panel? Won't there be any memory leak by
adopting the above procedure of disconnecting a child from its parent? If
so, how do we take care of it?
Thanks in advance!
Alaiah Chandrashekar
The following is the segment of the code which could be useful for clarity:
// Draws the Bar Graph for the first time.
self.ShowChart(TestData);
self.Open();
event loop
when task.Shutdown do
exit;
// When the window is resized
// I am scaling the Bar Graph for the new
// panel size.
when self.window.AfterReSize do
self.ClearChartPanel();
// self.window.UpdateDisplay();
self.ShowChart(TestData);
end event;
self.Close();
Method ClearChartPanel is as follows:
for child in self.<ChartPanel>.Children do
child.Parent = NIL;
end for;Hello Evandro,
I am listing the steps to create a relationship manually.
1. Create 2 records in the relationship table in console, one for "Married to" and the other one for "Owner". In order to do that the repository needs to be unloaded.
2. Once you create these 2 records in the table through console, load the repository.
3. Log on to the Data Manager.
4. Now as per your example, there are 3 records in the main table, namely
JOHN
MARY
ACME
5. Select only one record in the record list area e.g. JOHN (where you see the list of records)
6. Then, in the record edit area, double click on the relationship tab,
7. New Window opens up.
8. HERE ALL THE OPTIONS ARE GRAYED OUT. But Select the relationship which you want to create, in our case married to.
9. Now select the record MARY in the record list area. (NOT in the pop window, but main window).
10. Then on the top bar menu, select Relationships --> Adds to Group.
11. Now close the Pop window and observe that the relationship has been created between JOHN and MARY.
Let me know if it worked for you. if not, post some more information about your problem such as where you tried to configure and what options were grayed out.
Please update.
Thanks
Shai
I need to do a relationship among the BP where each record in Main Table correspond a BP (Person or Organization).
The relationship should link the BPs as shown below:
Records
1; John
2; Mary
3; ACME
In record 1, I need to say that John is married with Mary, where Married is a type of the relationship and that Mary is Owner of the ACME, where u201COwneru201D is other relationship type.
I have tried to configure a Relationship (where the parent and child tables were the Main Table) in MDM, but I couldnu2019t to do it because the screen for this feature was locked. I need to be certified that the child link exist in the repository.
Thank you.
Evandro.
Maybe you are looking for
-
Can't Figure Out Why iPhone 5 Battery Will Not Last
New to the community and looking for some extra insight into my problems. Cliffs Notes: iPhone 5 won't last more than 4-5 hours on a single charge. When I got my iPhone 5 on launch day I set it up as a new phone and did not restore from a backup. Onl
-
Error after importing PAR file into NWDS
Hi Experts, I have imported a par file into my NWDS worlspace . While building the project it's giving the following error . import javax.servlet.http.HttpServletResponse can't be resolved . While i am organizing the importa , the same import is gett
-
How to make bubble texts and captions linkable.
Greetings from Australia I am trying to use iBooks Author for creating a genealogy book containing lots of text and being quite picture-laden. The Gallery widget is superb for all my pics and the Glossary comes in handy for the heaps of genealogy tex
-
Cannot see users with server 10.7.3 update
I updated to 10.7.3 and when I launch the server app I see only the administrator user in the users pane (all other users do not show up). Further, the knobs for + and - are grayed (disabled). I still can log in with any network user, though. How can
-
Can I use my Iphone camera in europe without incurring roaming charges?