Populate a column conditional on data from another column???

The simplest way to populate your database with test data.

Moderators: David Atkinson, Anu Deshpande, Lionel

Populate a column conditional on data from another column???

Postby nolan118 » Fri Jun 13, 2008 4:41 pm

Is it possible to configure a column to be populated based on the values of another column within the table?

For example,
I have a table with two fields both integers. I configure column A to be populated with a random number between 0 and 10.
Now I only want column B to be populated (with the value 1) if column A is greater than 5.

Is this possible?

Thanks in advance
:)
nolan118
 
Posts: 1
Joined: Fri Jun 13, 2008 4:33 pm

Postby benhall » Fri Jun 13, 2008 5:32 pm

Hello,

Thanks for your post. Currently, this is not possible within the application, however I have made a note to review your request for future versions.

Thanks

Ben
benhall
 
Posts: 69
Joined: Fri Dec 14, 2007 11:15 am

Postby dlutz » Wed Jul 23, 2008 5:46 pm

No reply necessary.

I would like to add my 2 cents on this feature - it would be VERY handy. I have a table where there is a CaseType column and a CaseSubType column. Some CaseType/CaseSubType value combinations are not valid. So to be able to constrain the value of CaseSubType based on the value of CaseType would be a great feature.
dlutz
 
Posts: 8
Joined: Sat Feb 16, 2008 4:54 am

Postby jarito » Wed Sep 02, 2009 2:00 pm

I would also like this. I have an app where every table has a Modified By and Modified Date. However, since we have a lot of legacy data, there are nulls in the columns. I would like to generate random modified by's, but then only generate a date if there is a non-null modify by.
jarito
 
Posts: 2
Joined: Wed Sep 02, 2009 1:54 pm

Similair bu tnot the same request

Postby Random Lengths » Wed Oct 14, 2009 4:44 pm

I have a reporting database, and I need the 5+ columns in my reporting tables to add up to a specific number, specifically 100%. I guess I could PIVOT a 3 column layout with ID, PercentGroup, Value but I would still need the column sections within each ID to add up to 100% before I PIVOT it.

Please consider this in your next development cycle
Random Lengths
 
Posts: 28
Joined: Mon Sep 29, 2008 11:02 pm
Location: Eugene, OR

Postby andrew.evans » Tue Nov 17, 2009 10:56 am

I'd also like to add my voice to get this included in the next release. I have a table that has a foreign key made up of two columns. This feature would enable me to populate the child table correctly and maintain the relationship.
andrew.evans
 
Posts: 1
Joined: Tue Nov 17, 2009 10:49 am

Postby fdivis » Mon Jan 11, 2010 1:33 pm

This feature would certainly be necessary. Especially in databases with moderate to high complexity where interdependency between tables is daily business.
The absence of the feature is one reason why the application is not in use here.
fdivis
 
Posts: 5
Joined: Tue Dec 12, 2006 9:10 am

Postby fatherjack » Wed Jan 20, 2010 3:04 pm

I have a similar issue.

In my table I have colA and colB, colA MUST be 1 if ColB has any value in it, otherwise colA should be 0. I cannot seem to get Data Generator to insert any rows, it just returns an error saying the INSERT conflivted with a check constraint.

In the UI I have colA set to bit, no nulls and colB to description allow nulls. I have the "when data is invalid" option set to "skip row".

Why do no rows get inserted? surely some rows must be generated that are colA=1, colB='Some text'??
-----------------------------------------
Senior DBA
Careers South West Ltd
fatherjack
 
Posts: 224
Joined: Tue Mar 13, 2007 12:33 pm
Location: Cornwall

Postby stevefromoz » Mon Jun 14, 2010 10:13 pm

Would like ot add my voice to the calls for this feature to be added.

My use case:

have a field with a numeric value (say Cost) and a second also numeric (say Price). Would like the ability to do the equivalent of

Price expression == $[Cost] * 1.8

or the reverse :)
stevefromoz
 
Posts: 1
Joined: Mon Jun 14, 2010 10:10 pm


Return to SQL Data Generator 1

Who is online

Users browsing this forum: No registered users and 0 guests