Red Gate forums :: View topic - Column Data Referenced / Selected by Another Columns Data
Return to www.red-gate.com RSS Feed Available

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

Column Data Referenced / Selected by Another Columns Data

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
aseniuk



Joined: 16 Jun 2009
Posts: 16

PostPosted: Mon Dec 07, 2009 7:17 pm    Post subject: Column Data Referenced / Selected by Another Columns Data Reply with quote

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.

Thanks
_________________
Database Analyst
Alberta Justice and Solicitor General
Back to top
View user's profile Send private message
Linda Hawksworth



Joined: 25 Jun 2007
Posts: 192

PostPosted: Wed Dec 09, 2009 11:46 am    Post subject: Reply with quote

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

http://www.simple-talk.com/content/article.aspx?article=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"
else
column.set "?"
end

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.
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