I have single table to populate with random data. One of fields is dependent on the other one. To be more precise when the value of the first field is H, I need to have random number between 10 and 250 in the second field, and when the value in the first field is S, the value in the second field should be between 10,000 and 250,000. I have created Python script to generate this random numbers.
In case of generating 10,000 or fewer records, everything works fine; but, in case of larger number of records (50K +), the script fails.

It looks as memory error to me. What do you guys think?

Error message:
The value " cannot be inserted into column EMP SALARY
RedGate.SQLDataGeneratorEngineDataGeneration.InvaIidCoIumnDataException: The value ' cannot be inserted
into column EMP SALARY at
RedGate.SQLDataGeneratorEngineDataGeneration.TypeTransIationDataReader.Read) at
SystemData.SqICIient.SqIBuIkCopyReadFromRowSource() ...

Script:
# Basic generator template
import clr
clr.AddReference("System")
from System import Random
random = Random();

def main(config):
if EMP_TYPE_CODE == 'H': out = random.Next(10, 200)
elif EMP_TYPE_CODE == 'S': out = random.Next(10000, 200000)
else: out = 10
return out
dmilov
0

Comments

2 comments

  • Rob C
    Hi,

    I'm going to create a support ticket to deal with this issue. You should receive an email shortly.
    Rob C
    0
  • mamiller
    Was this issue ever solved? I'm having a similar issue with one of my Python scripts and have been unable to find a fix for it.
    mamiller
    0

Add comment

Please sign in to leave a comment.