Red Gate forums :: View topic - How to use the SQL Statement generator?
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

How to use the SQL Statement generator?

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



Joined: 19 Jul 2012
Posts: 16

PostPosted: Fri Sep 07, 2012 11:50 pm    Post subject: How to use the SQL Statement generator? Reply with quote

Hi,

How can I use the value of a column (the value of which is generated by the decimal/numeric generator) to generate the value of another column? For example, I have a table with Height and Weight columns. I am generating values for the Height column using the decimal/numeric generator. Then I want to use the Height value to produce a corresponding Weight value. I thought I should be able to use the SQL Statement generator to do this, but either it doesn't work, or I am not using it correctly. For instance, I would like to do something like this:

SELECT 25 * Height * Height FROM <tablename>

and store the result in the Weight column, and have it work for each row that gets generated.

Unfortunately, the values I get back don't make sense.

Any suggestions?

Thanks,

Dennis
Back to top
View user's profile Send private message
gvsoft



Joined: 19 Jul 2012
Posts: 16

PostPosted: Fri Sep 07, 2012 11:56 pm    Post subject: Reply with quote

Nevermind. Problem solved...I had the "Shuffle data" checkbox checked. Unchecking that gave me the result I was looking for.

- Dennis
Back to top
View user's profile Send private message
gvsoft



Joined: 19 Jul 2012
Posts: 16

PostPosted: Sat Sep 08, 2012 12:08 am    Post subject: Reply with quote

I take it back...it doesn't work. It works, but it uses the data currently in the database as the source, not the generated data values. I want it to use the generated values from the other column. Is this even possible?

- Dennis
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6582

PostPosted: Mon Sep 10, 2012 9:40 am    Post subject: Reply with quote

Hi Dennis,


SQL Data Generator currently does not support generating data for a column based on data generated for another column in the same table. The workaround is to use the Iron Ruby Generator, but this is pretty difficult to do.

Please see topic:
http://www.red-gate.com/MessageBoard/viewtopic.php?t=14563&highlight=ruby

I may need to do a new build of Ruby generator if you are using a different version of SQL Data Generator.
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