What are the challenges you face when working across database platforms? Take the survey
Options

RegExpGenerator and Insert Table Column

facklecfacklec Posts: 7 New member
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?

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I think you're after something similar to this: http://www.red-gate.com/MessageBoard/vi ... hp?t=15979
  • Options
    facklecfacklec Posts: 7 New member
    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.
Sign In or Register to comment.