Test Data Manager

Expand all | Collapse all

Creating a pool from a subset with identity fields (ORACLE)

  • 1.  Creating a pool from a subset with identity fields (ORACLE)

    Posted Jan 18, 2018 11:53 AM

    Hello;

     

    We created a datapool, using a subset generated by GTSUBSET.

    On "Row Population Rules" we created it, using rule set "Subset Rules".

    But when we tried to run it, it give errors, because there are some identity columns that can´t be inserted as it comes from the Source.

    The question is, how we configure the "Row Population Rules", to automatically manage the Identity PK on the main table, and propagate it to al the children tables their FK?

    If we can´t resolve it directly from "Row Population Rules", how we change the fields on "edit pool", to resolve it?

     

    Thx



  • 2.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Posted Jan 18, 2018 12:25 PM

    Hi, can you please supply the full error message or a screenshot of it?



  • 3.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Posted Jan 18, 2018 12:27 PM

    I see you also opened a support case, 00939889, for this issue. dovle01 will be working with you on troubleshooting this as well through the support case. We will post the resolution once found. Feel free to keep us updated on the community post as well.



  • 4.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Posted Jan 18, 2018 12:37 PM

    Hi Gill;

     

    I´m asking for the customer to send me the error; to post...

     

    But, how we can deal with identity columns on Datamaker?

     

    In a "normal" field, we get the content from the source connection, something like this:

     

    @seqlov(0,@sqllist(P~DataSource~,"SELECT * FROM [dbo].[Table1]  WHERE Date='~Date' ")@,~COLUMN_NAME~)@

     

    But if we put it on a identity field, it will give me error because the field is generated by the database system...



  • 5.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Broadcom Employee
    Posted Jan 18, 2018 01:21 PM

    Are you using Oracle 12 since identity fields are not available in earlier version of Oracle? If you are using 12 then you will need to find the sequence being used in the back end and use next val on that.



  • 6.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Posted Jan 19, 2018 06:52 AM

    Hello Anil;

     

    I think i understand...

     

    Looking at the DOCOPS, i find this (Working with Columns - CA Test Data Manager - 4.4 - CA Technologies Documentation ):

     

     

    *For example, 2 tables (TABLE1 PK, TABLE2 FK:

    TABLE1 - CODE identity

                    FIELD1                 .

     

    TABLE2 - CODE (FK from TABLE1)

                     FIELD1

                     FIELD2       

     

    On TABLE1 (looking on datamaker, edit DATAPOOL), i will use something like this:

     

    On TABLE2, it recomend me to use "~parent(1)~", like this:

     

    That´s correct???

     

     

    Thx for the help again Anil!



  • 7.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Broadcom Employee
    Posted Jan 19, 2018 11:32 AM

    Yes that should work.



  • 8.  Re: Creating a pool from a subset with identity fields (ORACLE)
    Best Answer

    Posted Jan 19, 2018 12:57 PM

    Anil;

     

    Support stated me that on Oracle, identity fields are not supported.

    They open a defect: 

    DE340552 - 00939889-Datamaker - Creating a subset, with identity columns (ORACLE).

     

    Thx everybody!



  • 9.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Posted Jan 19, 2018 01:07 PM

    Now converted to user story US449340. In case you need for tracking purposes. Here is the normal enhancement process and what to expect next: https://support.ca.com/us/knowledge-base-articles.TEC1107947.html 



  • 10.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Broadcom Employee
    Posted Jan 19, 2018 04:29 PM

    In the meanwhile if you still want to use the identity column on Oracle 12, you could find out the sequence being used in the column using the query below and use that manually in your data pool.

     

    Select TABLE_NAME, COLUMN_NAME, DATA_DEFAULT from USER_TAB_COLUMNS
    where TABLE_NAME = 'TABLE_NAME';

     

    Find the sequence name from above query and model @nextval(sequence_name)@



  • 11.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Posted Jan 22, 2018 11:04 AM

    Anil;

     

    The @nextval(sequenc_name)@, works... Similar to using ~NEXT~, if the field has a default sequence on it...

    But, my trouble is on the FK references... How i work with it...

    I tried using ~PARENT(1)~; on the FK and it still returning me that parent could not be resolved...



  • 12.  Re: Creating a pool from a subset with identity fields (ORACLE)

    Broadcom Employee
    Posted Jan 22, 2018 11:31 AM

    Can you refer to the table directly instead of using PARENT like the below and try?

     

    ^TABLE.PKCOL(1)^