Red Gate forums :: View topic - Gender-Name Dependency
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 2
SQL Data Generator 2 forum

Gender-Name Dependency

Search in SQL Data Generator 2 forum
Post new topic   Reply to topic
Jump to:  
Author Message
softworksgroup



Joined: 02 Apr 2012
Posts: 2

PostPosted: Tue Apr 03, 2012 12:31 am    Post subject: Gender-Name Dependency Reply with quote

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
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6589

PostPosted: Wed Apr 04, 2012 12:42 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group