Gender-Name Dependency

The simplest way to populate your database with test data.

Gender-Name Dependency

Postby softworksgroup » Tue Apr 03, 2012 12:31 am

Is there a way to choose a gender value based on the gender of the name that has been chosen? I did see a reference to using a plug-in for this on the SQL Data Generator 1 forum, but I'm wondering if it is possible without a plug-in or creating a custom generator.

I do have a "names" table available in a sample data DB where the association between names and genders exist. Specifically, the source table has a "NameType" (first, last), "Gender" (male, female) and "Name" (Bob, Peter, Johnson, Obama, etc.) column.

I see how I can assign the "name" column from the source query into the FirstName, MiddleName, and LastName columns in the target table, but not how to choose a name type nor how to assign the gender value from the same source record.

Is there a way to do this?

Thanks
softworksgroup
 
Posts: 2
Joined: Mon Apr 02, 2012 11:40 pm

Postby Brian Donahue » Wed Apr 04, 2012 12:42 pm

Hi,

This still comes down to the same basic problem that you can't derive data from one field in a row of data and apply it to another field in the same row. So the best workaround if you want to use dynamic logic to assign gender would be the Ruby Generator.

If you wanted to do it without Ruby, you could crate a table or CSV with one column having names and another having genders and use the SQL or CSV table import generators.
Brian Donahue
 
Posts: 6590
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Data Generator Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests

cron