How to use the SQL Statement generator?
gvsoft
Posts: 20 Bronze 1
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
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
Comments
- Dennis
- 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/vi ... light=ruby
I may need to do a new build of Ruby generator if you are using a different version of SQL Data Generator.