| Author |
Message |
kiran.karamsetti
Joined: 02 Jan 2009 Posts: 4
|
Posted: Fri Jan 02, 2009 8:36 am Post subject: Regarding SQL STATEMENT generator |
|
|
Hi ,
I have tables like:
1. Rep(RepID, rep_name,Active) -> has id= 1 to 100 records
2. Role(RoleID, RoleCode, Active) -> has id = 1 to 30 records
3. RepRole(ID, RepID, RoleID)
and I need to populate the below table:
Table_1(id,name, created_repID,Created_RoleID).
So i am generating the data for created_repID randomly between 1 to 100. And I need to populate the Tables_1.Created_roleID from the REPROLE table for that respective Created_repID. How can I do this in RedGate generator tool?
Here i tried to write a query:
how to complete the below query. I need to pass the table_1.Created_repID as the parameter to the below query.
"Select RoleID from RepRole where repid =" + ?;
please give me a suggestion.
Last edited by kiran.karamsetti on Mon Jan 05, 2009 1:42 pm; edited 1 time in total |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Fri Jan 02, 2009 4:02 pm Post subject: |
|
|
Hi,
It's not documented but I have been told that Data Generator cannot use newly-generated values to populate another column, so it wouldn't be possible to access data that has not yet been inserted into the database.
You could use a foreign key generator or foreign key (manual) generator to populate values from one column into another column. _________________ 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