Test Data Manager

  • 1.  I am having difficulty getting an addition of more than one row in a layout.

    Posted Oct 17, 2017 08:34 AM
    Good Morning.  It has three layouts of one file (header, detail and trailer). It made the set of my columns through the SQL command. The problem is: when I get the file (header + detail + trailer), I can not add more than one detail line. Is there any method or command to automatically add more than one row when generating content in the "detail" field?



  • 2.  Re: I am having difficulty getting an addition of more than one row in a layout.

    Posted Oct 17, 2017 09:27 AM

    You have some options to do that, and it's related with what you are trying to accomplish.

     

    The error is occurring because your query is trying to put multiple values on a column, what it's not allowed. You can simply change your query, adding a TOP 1, to select the first element of the query result.

     

    If you need to get, sequentially a value from a column, using the query you mentioned, you can use SEQLOV.

     

    But I recommend you to check this Doc, to see what options you have within data-painter:

    Data Generation Functions and Parameters - CA Test Data Manager - 4.2 - CA Technologies Documentation 



  • 3.  Re: I am having difficulty getting an addition of more than one row in a layout.

    Broadcom Employee
    Posted Oct 17, 2017 09:33 AM

    Bruno,

     

    The error is because you are returning more than one row and assigning to a single row. To be able to iterate though the rows you need to use a function like SEQLOV or RANDLOV.

     

    @seqlov(0,@sqllist(T,SELECT ~COLUMN_NAME~ FROM TABLE_NAME)@)@

     

    Thanks,

    Anil



  • 4.  Re: I am having difficulty getting an addition of more than one row in a layout.

    Posted Oct 17, 2017 12:06 PM

    Thank you for your help. But I could not solve my problem. because when you generate the file, it is created with only one line, not all lines.

     

    Example:

     

    This is my base "detail".

    x

    I want to generate all the rows in the table.

    But, I can only put a header line in the file through the configuration on this screen.  I know it is possible to manually add several lines to this tel. But, my file can have n rows in the "detail".

     

    But I would like it to navigate all lines and export them to the file generation (publish)

     

     

    This is the file that is generated (just a line of the detail)

     

    How it should be:



  • 5.  Re: I am having difficulty getting an addition of more than one row in a layout.
    Best Answer

    Broadcom Employee
    Posted Oct 17, 2017 12:46 PM

    Bruno,

     

    To get more than one line, you should change the Table Repeat count for the body record by right licking on it in the publish screen. You can then set the repeat count to a hard coded value like 10 based on the number of rows you need or if it is dynamic then you can use a count sql query like the below to get the repeat count.

     

    @execsql(T,SELECT COUNT(*) FROM TABLE_NAME WHERE ID = 1)@

     

     

     

    Thanks,

    Anil



  • 6.  Re: I am having difficulty getting an addition of more than one row in a layout.

    Posted Oct 17, 2017 01:19 PM

    OK.

     

    It worked, it brought all the values plus, deformatou my layout.

     



  • 7.  Re: I am having difficulty getting an addition of more than one row in a layout.

    Broadcom Employee
    Posted Oct 17, 2017 01:24 PM

    In the FD template you created for this file, did you set the below parameter

     

    LINE_SEPARATOR=<CR><LF> or LINE_SEPARATOR=<LF>