[resolved] use Trowgenerator output as input for another tRowgenerator

One Star

[resolved] use Trowgenerator output as input for another tRowgenerator

hi, I am using tRowgenerator to generate a test set of data into mysql.
I have two files which are related in 1:N. so file 1 Header with a unique key and file 2 detail with unique key field 1 and field 2.
field 1 for both files is the same, field 2 in the second file is a sequence number.
Since I want to use tRowgenerator to generate lines in the Detail file I need to know the unique key value generated by the TRowgenerator in the first file.
to the first tRowgenerator will generate his output to mysql using tmysqloutput. I also use the the connect Row Iterate from the first TRowgenerator to the second tRowgenerator (for every row generated by the first one I want to generate a number of lines in the second). how can I use the values created in the first tRowgenerator in the function parameters of the second tRowgenerator?

Accepted Solutions
One Star

Re: [resolved] use Trowgenerator output as input for another tRowgenerator

I linked tIteratetoFlow with iterate to the first Rowgenerator and then tMySqlOutput.
this worked fine.
so;
toRowGenerator -> (iterate) tIterateToFlow->(main) tMySqlOutput
|
row(main)
tFlowIterate ->row2(main)tRowGenerator2->(main)tMySqlOutput

All Replies
One Star

Re: [resolved] use Trowgenerator output as input for another tRowgenerator

I think that using tFlowToIterate should work as it puts the data into variables you can reference in each iteration.
tRowGenerator->tFlowToIterate->tRowGenerator 
One Star

Re: [resolved] use Trowgenerator output as input for another tRowgenerator

thanks, this seems to work. this brings me to my next question. If I use
tRowGenerator->tFlowToIterate->
it connects via row(main)
in my previous code I used row(main) to connect tRowGenerator->TmySQLOutput
now I can use the data from tFlowToIterate for my next tRowGenerator but I cannot find a way to store the data from the first tRowgenerator in the database.
One Star

Re: [resolved] use Trowgenerator output as input for another tRowgenerator

Seems like you could have the second row generator output the first row generators values as constants for each iteration.
Alternatively, add those variables from the first generator in columns in a tMap after the second generator.
Never tried this before.  Let me know how it goes.
One Star

Re: [resolved] use Trowgenerator output as input for another tRowgenerator

I linked tIteratetoFlow with iterate to the first Rowgenerator and then tMySqlOutput.
this worked fine.
so;
toRowGenerator -> (iterate) tIterateToFlow->(main) tMySqlOutput
|
row(main)
tFlowIterate ->row2(main)tRowGenerator2->(main)tMySqlOutput