Test Data Manager

  • 1.  Datamaker Subsetting - Manage relationship between tables

    Posted Jan 09, 2018 12:46 PM

    Hello; 

     

    Actually i´m working to generate a subset, and publishing it by a CA Datamaker DataPool...

     

    Here is a trouble i´m facing now...

    I have a Mother table (tab1), that have many tables related.

     

    I have to recreate the Key field of the main table, using data i get from a free numbers table, wich set me the next code for it...

     

    It´s working, i can get the new value from the field, on the main table normally...

    But i need to use the new key created, on to the child tables.

     

    On the child tables, i tried to use ^Tab1.KeyField(1)^, like this (First line, main table with the function, second child table...):

    Example

    But using that way, i´m always getting the number 1 row of the principal table.

     

    How can i manage the relationship between all tables?

     

    Thx

     

    Danilo



  • 2.  Re: Datamaker Subsetting - Manage relationship between tables

    Broadcom Employee
    Posted Jan 09, 2018 12:55 PM

    Danilo,

     

    Just so that I understand your question better, are you saying that after setting ^Tab1.KeyField(1)^ in your child table, you are getting the same key value for all rows in your child tables rather than different ones as per the primary table?



  • 3.  Re: Datamaker Subsetting - Manage relationship between tables

    Posted Jan 09, 2018 01:33 PM

    Anil,

     

    Hi.

     

    I haven´t published the pool on the data target yet...

    I´m just generate the SQL files, to catch some errors, before a real publish...

    Analizing the SQL files generated, i found that; it just getting the first of the key on all the insert´s it create....

     

    Look at these examples:

     

    197302972 is the key of the first row of the main table...

    Using this notation ^Tab1.KeyField(1)^, the number 1, didn´t point to the first row of the table?

     

    Thx Anil!



  • 4.  Re: Datamaker Subsetting - Manage relationship between tables
    Best Answer

    Broadcom Employee
    Posted Jan 09, 2018 03:22 PM

    Can you change the rule to the below and try generating the SQL files?

       

       ^Tab1.KeyField(~ROWNUM~)^



  • 5.  Re: Datamaker Subsetting - Manage relationship between tables

    Posted Jan 10, 2018 05:43 AM

    Anil;

     

    It works!!!!

    Thx my friend!

     

    Danilo



  • 6.  Re: Datamaker Subsetting - Manage relationship between tables

    Posted Jan 10, 2018 06:13 AM

    Anil;

     

    Bad news...

    My first test was with just the main table and one child...

    I tried it again, with more tables; and it returned me that error:

     

    The first example, where a one to one relationship...

    But, on this error case, it´s not a one to one...

    The main table have 2 rows, the child table has 13!

     

    It´s getting the rownumber of the child table, not the main table...

    So, when it tries to get the register on the row 3, it crashes!!!

     

    Any advice???

     

    Thx

     

    Danilo



  • 7.  Re: Datamaker Subsetting - Manage relationship between tables

    Broadcom Employee
    Posted Jan 10, 2018 11:14 AM

    Danilo,

     

    Since your situation is more complex, it will need to be looked into in detail to identify a solution. I would suggest you raise a support ticket so that the team can look into the same.

     

    https://support.ca.com



  • 8.  Re: Datamaker Subsetting - Manage relationship between tables

    Posted Jan 10, 2018 11:33 AM

    Thx Anil!

     

    I will try it...