Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Data Dictionary Confusion

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    826

    Default Data Dictionary Confusion

    I think I need to go back to DD school. I expect this to work

    Properly constructed and connected set of Data Dictionary Objects
    Parent
    |
    Child
    |
    Grandchild
    |
    Great_Grandchild

    Code:
    Send Clear of Great_Grandchild_DD
    Move Unique ID to Great_Grandchild Unique ID column
    Send Find of Great_Grandchild_DD EQ Index.1        //Primary index on Unique ID column
    If does not matter if I
    Send Clear or Send Request_Clear
    Send Clear of Great grandchild or Send Clear of Parent
    Send Find or Send Request_Find

    The Great grandchild record is not found - in fact nothing in the structure is found

    If I change “Send Find” to “Send Request_Superfind” it does want I expect a Find to do.


    • Clear propagates up - so clearing the Great grandchild should clear the complete structure
    • Find should relate - so all of the parents should also be found.


    What am I not understaning?

    I’m very confused
    Ian Smith
    (Member of the SigCj project)

  2. #2
    Join Date
    Mar 2009
    Posts
    1,291

    Default Re: Data Dictionary Confusion

    Let me preface this with this is only my understanding

    1) If you clear a child DD, the parent DD should NOT be cleared.
    2) If you clear the parent DD, all the child DDs are cleared.
    3) Therefore when you stick the unique id to the child file buffer, then do a find, it all depends on whether the "intended" child record is a child record of the current parent record. (sorry if that sounds super confusing)

    Frank Cheng

  3. #3
    Join Date
    Feb 2009
    Location
    Hengelo (NL)
    Posts
    1,891

    Default Re: Data Dictionary Confusion

    Original code looks fine to me.
    Note that a constrain_file will stop the clearing to the parent.

  4. #4
    Join Date
    Feb 2009
    Location
    Stuart, FL
    Posts
    5,321

    Default Re: Data Dictionary Confusion

    depends on the constraints
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    IT Director at Balloons Everywhere

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    826

    Default Re: Data Dictionary Confusion

    No Constraints, so what else could be stopping the find?

    Frank
    I downloaded the DataFlex 3.2 Data Dictionary Guide which states on page 58
    The clear message clears the main_file of the DDO and then propagates up the dataserver
    structure. Clear does not propagate down.
    If I remember correctly in the good old days of procedural code, Clear File would clear down the structure – the opposite to DDs
    Ian Smith
    (Member of the SigCj project)

  6. #6
    Join Date
    Feb 2009
    Location
    Stuart, FL
    Posts
    5,321

    Default Re: Data Dictionary Confusion

    if there are no constraints a clear sent to PARENT should only clear that, a clear to GREAT_GRAND_CHILD should clear all

    here is what i would do

    create a simple view with your DDs and forms for each DD (no grid)

    than test your finds and clears

    do you have any code in for example a procedure refresh or entry_display. if you modify the found indicator in these you can stop a find
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    IT Director at Balloons Everywhere

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  7. #7
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    5,445

    Default Re: Data Dictionary Confusion

    I agree with michael

    4 possible areas that I can think:

    1. Constraints - you said you have none !

    2. Missing parent records / Orphan rows.

    Make sure the row you are trying to find in grand_child has valid parent records (all way up)!
    If a parent is missing, and ParentNullAllowed is not properly configured, then the find will not happen at dd layer.
    It will at global buffer layer, but no in DD layer .

    3. DEOs/ grids, and other objects logic. So, I would test this completely isolated in a separate .src, just plain code, no visual objects. to make sure nothing else is messing up.

    4. Corrupted indexes -


    Good luck
    Samuel Pizarro

  8. #8
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Data Dictionary Confusion

    Ian,

    If I remember correctly in the good old days of procedural code, Clear File would clear down the structure – the opposite to DDs
    No, in procedural code a clear of a table was only doing the table mentioned. No parents, no childs.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  9. #9
    Join Date
    Feb 2009
    Location
    Fresno, CA
    Posts
    1,072

    Default Re: Data Dictionary Confusion

    It looks like it should work to me; I would check the constraints in the parent DDOs to make sure that one of the parents isn't messing things up by not meeting one or more constraints in effect.
    One way to test this is to do a manual find on the great grandchild record (e.g. "Find eq great_grandchild by index.1") then do a Relate Great_Grandchild (which should bring in all parent records to the global record buffers) then try sending request_assign to each of the parent DDOs for there respective records. If one fails to latch onto the record currently in the buffer it is normally going to be due to a constraint not matching.
    Another way of course is to find the record of the main file of the view that the target great_grandchild record should be displayed under and see if everything displays correctly.
    Best regards,

    Matt Davidian
    Datatech
    Fresno, CA
    www.datatechag.com

  10. #10
    Join Date
    Jun 2016
    Location
    Point Cook, Victoria, Australia
    Posts
    572

    Default Re: Data Dictionary Confusion

    With the caveat that there are no constraints, that you are using the correct Set DDO_Server to "related_parent" and the Main_File/Server is set to the Great_GrandChild, any find or clear in the Great_GrandChild will either find or clear from the Great_GrandChild all the way up to the Parent.

    Absolutely no superfinds necessary!!!

    Code:
    Object oParent_DD is a cParent_DataDictionary
    End_Object
    
    Object oChild_DD is a cChild_DataDictionary
        Set DDO_Server to oParent_DD
    End_Object
    
    Object oGrandChild_DD is a cGrandChild_DataDictionary
        Set DDO_Server to oChild_DD
    End_Object
    
    Object oGreat_GrandChild_DD is a cGreat_GrandChild_DataDictionary
        Set DDO_Server to oGrandChild_DD
    End_Object
    
    Set Main_File to oGreat_GrandChild
    Set Server to oGreat_GrandChild
    Regards,
    Rachael Warlond

    1) When programming, never reinvent the wheel.
    2) If it works, leave well enough alone.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •