AnsweredAssumed Answered

What function to use for grabbing unique data from tableA.columnA and randomly populating tableB.columnB

Question asked by ThanNguyen82306198 on Jun 21, 2016
Latest reply on Jul 28, 2016 by ThanNguyen82306198



I would like to create some synthetic data in a couple of tables.  The first table is the header/parent table, and the second table is the detail/child table.  If I publish 2 records in the header table, each having a unique name in the Name column, what is the function that I would use to populate the Name column in the detail table using each of those unique names from the header table?



Published synthetic data in the header table contain 2 records with the following columns:

Name | ZipCode

Joe | 12345

Mary | 67891


Need to publish synthetic data in the detail table with the following columns:

Name | ZipCode | Address

Joe | 12345 | 333 St. Name St.

Joe | 12345 | 444 St. Name Ct.

Joe | 12345 | 555 St. Name Ln.

Mary | 67891 | 666 St. Name Rd.

Mary | 67891 | 777 St. Name Pl.


What function could I use to generate random names in the detail table from the distinct list of names in the header table?  I tried using the randlov(percnull,@sqllist(connection,sql)@) and the randlov(percnull,@sqllist(connection,sql)@)coumn) functions but both aren't returning the data I'm expecting.


@randlov(0,@sqllist(T,select distinct Name from Header)@)@


Thank you,