What are the challenges you face when working across database platforms? Take the survey

Gender-Name Dependency

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?



  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1

    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.
Sign In or Register to comment.