Comments
Sort by recent activity
Many thanks Robyn / comments
Many thanks Robyn
Many thanks Robyn, That makes sense not to share between users. Regarding the physical location, what is the currently and can I set this? Thanks
/ comments
Many thanks Robyn,That makes sense not to share between users.Regarding the physical location, what is the currently and can I set this?Thanks
Many thanks Alex, That example is clear to understand.
Alex B said:
Hi @Sanjshah, SQL Data Generator uses IronPython and it appears this is still version 2.7 included with the install so a lot of newer functionality is not available (e.g. random.choices). You may be able to use something like the following to get a random selection from the list foo import clr
clr.AddReference("System")
from System import Random
random = Random()
def main(config):
# config["column_name"] is the column name
# config["column_type"] is the column datatype
# config["column_size"] is the column size
# config["n_rows"] is the number of rows
# config["seed"] is the current random seed
foo = list('abcde')
val = ''
if (col2 == 1) or (col2 == 2):
val = foo[int(random.Next(len(foo)))]
else:
val = 'awaiting'
return valAnd it gives you output like this:
[image] I hope that helps! Kind regards, Alex
/ comments
Many thanks Alex,That example is clear to understand.
Alex B said:
Hi @Sanjshah,SQL Data Generator uses IronPython and it appears this is still version 2.7 included with the install so a lot...