| Author |
Message |
gvsoft
Joined: 19 Jul 2012 Posts: 16
|
Posted: Fri Sep 07, 2012 11:50 pm Post subject: How to use the SQL Statement generator? |
|
|
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 |
|
 |
gvsoft
Joined: 19 Jul 2012 Posts: 16
|
Posted: Fri Sep 07, 2012 11:56 pm Post subject: |
|
|
Nevermind. Problem solved...I had the "Shuffle data" checkbox checked. Unchecking that gave me the result I was looking for.
- Dennis |
|
| Back to top |
|
 |
gvsoft
Joined: 19 Jul 2012 Posts: 16
|
Posted: Sat Sep 08, 2012 12:08 am Post subject: |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6343 Location: Red Gate Software
|
Posted: Mon Sep 10, 2012 9:40 am Post subject: |
|
|
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. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|
|
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