Column Data Referenced / Selected by Another Columns Data

The simplest way to populate your database with test data.

Column Data Referenced / Selected by Another Columns Data

Postby aseniuk » Mon Dec 07, 2009 6:17 pm

Hi All,

I was wondering how I would do something like this. Lets say we want to get the gender of the person or rather select the gender first then fill in an appropriate name based on the gender.

Other areas where this would also be handy would be postal code, filling in the postal code based on the country/stat and, Phone numbers.

If anyone has an idea on how to achieve this please give me a post.

Database Analyst
Alberta Justice and Solicitor General
Posts: 16
Joined: Tue Jun 16, 2009 7:51 pm

Postby Linda Hawksworth » Wed Dec 09, 2009 10:46 am

SQL Data Generator will not do what you want out of the box but please see the following article: ... rticle=697

which explains how to use the IronRuby generator to manipulate data. Specifically, please see the example of using conditional logis in that article:

title = table.row("Title")
if(title == "Mr")
column.set "M"
elsif(title == "Miss" or title == “Ms”)
column.set "F"
column.set "?"

You can use the NamesFirstMale.xml and NamesFirstFemale.xml files in the above code to specify male or female names in a specific column base on gender.

Let me know if this is what you need.
Linda Hawksworth
Posts: 192
Joined: Mon Jun 25, 2007 10:32 am

Return to SQL Data Generator Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests