RegExpGenerator and Insert Table Column

The simplest way to populate your database with test data.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Michelle Taylor, Lionel, Emma A, sherr

RegExpGenerator and Insert Table Column

Postby facklec » Wed Jun 26, 2013 8:01 pm

I want to use a RegExp to change a value incrementally everytime another column changes values. Column A (which ends in a digit) repeats for x number of rows. I need Column B to start at some number and increase by 1 for each row until Column A changes values. I thought if I could grab that last digit and increment its value but this is way beyond my skills. Can anyone help me. Is it possible? Or can I only add to the Insert Table Column Value?
facklec
 
Posts: 5
Joined: Wed Jun 26, 2013 7:36 pm
Location: Olympia, WA

Postby Brian Donahue » Fri Jun 28, 2013 8:48 am

Natively, SQL Data Generator doesn't support updating one column from a generated value in another column of the same table.

The workaround for this was an (unsupported) third-party add-in for SDG that allowed you to generate the data using a Ruby script. (note: the built-in Python script generator sadly doesn't have this capability).

So you *could* use the Ruby gen to derive values from one column *or* you could use the Python generator on both columns to generate a predictable set of numbers that you know will result in the requirement being filled.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby Brian Donahue » Fri Jun 28, 2013 9:08 am

I think you're after something similar to this: http://www.red-gate.com/MessageBoard/vi ... hp?t=15979
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

One small problem

Postby facklec » Wed Jul 10, 2013 5:47 pm

Brian, thanks, this will definately be helpful in a lot of circumstances only unfortuately in this particular case my TableA PK is not an integer, it's a string with alpha/numeric combination.
facklec
 
Posts: 5
Joined: Wed Jun 26, 2013 7:36 pm
Location: Olympia, WA


Return to SQL Data Generator 2

Who is online

Users browsing this forum: No registered users and 0 guests