Comments
2 comments
-
What you really have here is a key of sorts. Does the database have any referential integrity for these columns? Or do you have a source database that has this type of constraint?
-
I tried a few things. One that does work, if you have the domain mapping, is to use this python function:
def main(config): penlist = ['A', 'B', 'C'] pencillist = ['D', 'E'] if Device == 'pen' or Device == 'Pen': return random.choice(penlist) else: return random.choice(pencillist)
I'm assuming here your colunm is Device, and this is the appropriate mapping. I did need to add a reference to my list of Python 2.7 libraries to get the random module.
Add comment
Please sign in to leave a comment.
I want to generate data in such a way that if the SQL Data Generator tool generates Pen for Column 2,then Column 1 should have data A or B or C only and if the tool generates Pencil for Column 2,then Column 1 should have D or E only.
How can these constraints be maintained?
Thanks in advance.