Test Data Manager

  • 1.  How to skip set of rows from the table?

    Posted Sep 23, 2017 10:04 AM

    Hi Team,

     

    I want to skip few rows while retrieving the data from the table.

     

    Ex: I am publishing the data into below two tables.

     

    Table1: CUSTOMER

    CUSTOMER_ID(PK)CUSTOMER_NAMEDOB
    1001Raj30/6/1977
    1002Sekhar4/3/2000

     

    Table2: CUSTOMER_CONTACT

     

    CUSTOMER_ID(FK)CUSTOMER_NAMEPHONE#
    1001Raj8877665544
    1002Sekhar9988776655

     

    First i have inserted 2 rows in CUSTOMER table and Inserted the 2 rows in CUSTOMER_CONTACT Table by retrieving teh data from CUSTOMER table using below function.

     

    @seqlov(0,@sqllist(S,SELECT CUSTOMER_ID FROM CUSTOMER)@)@

     

    --> Now i have inserted 2 more rows in CUSTOMER Table as below.

     

    Table1: CUSTOMER

    CUSTOMER_ID(PK)CUSTOMER_NAMEDOB
    1001Raj30/6/1977
    1002Sekhar4/3/2000
    1003john6/7/1988
    1004tom8/9/1999

          

    Now i want publish two more rows in CUSTOMER_CONTACT Table for teh two new rows in CUSTOMER table.

    How to skip first 2 rows while retrieving the data from teh customer table.

     

    Please suggest me how can i proceed.

     

    Thanks,

    Rajasekhar



  • 2.  Re: How to skip set of rows from the table?
    Best Answer

    Broadcom Employee
    Posted Sep 25, 2017 03:51 AM

    Hi,

     

    That can be done by altering the statement:

    @seqlov(0,@sqllist(S,SELECT CUSTOMER_ID FROM CUSTOMER)@)@

     

    So that it uses the data from the Target instead of the Source and altering the query to return only the records which don't have a record in CUSTOMER_CONTACT.

     

    Best regards,

    Peter

     



  • 3.  Re: How to skip set of rows from the table?

    Broadcom Employee
    Posted Sep 25, 2017 10:34 AM

    Rajasekhar,

     

    You could publish both tables at once and refer the CUSTOMER_ID column in CUSTOMER_CONTACT to the CUSTOMER table like the below so that you don't need to worry about maintaining the correct ID's.

    ^CUSTOMER.CUSTOMER_ID(1)^

     

    If you want to keep what you are doing just change the query to the below so that it only fetches the relevant records from customer table.

     

    @seqlov(0,@sqllist(S,SELECT CUSTOMER_ID FROM CUSTOMER WHERE CUSTOMER_ID NOT IN (SELECT CUSTOMER_ID FROM CUSTOMER_CONTACT))@)@

     

    Thanks,

    Anil



  • 4.  Re: How to skip set of rows from the table?

    Posted Sep 28, 2017 12:00 AM

    Thank You ANil for your support and help. it worked for me.