selects in Data Generator

TenGor

Member³
Hy,

is it possible to select something within Data Generator?

f.e. a text from a table which is not the Master of the table

or use the foreign key within a text-field like this where "kenska" is the Master table:
'xxx :' + kenska.nr

the field "kenska.nr" is used as the foreign key within the Child table

the result should something like this:
"xxx : 1"
"xxx : 2"
 
You can use the List(select statement) function. For example:

List(select dname from dept)

The data generator will randomly pick a value from the result set. You cannot use any variables in the select statement though.
 
Hy,

if got a problem with the functions
- List(select dname from dept)
- List('1', '2')
- Random(1, 10)

I use it the follwoing way:
I have a Master-Table (TAB_A) and a n-m table (TAB_NM).
The TAB_A has the colums:
ID
MYNAME
The TAB_NM has the colums:
ID
FK_TAB_A
FK_TAB_B

I want to fill the two tables with the following functions of Data Generator:
TAB_A
ID Sequence(2000)
MYNAME 'User_' + Sequence(2000)

TAB_NM
ID Sequence(2000)
FK_TAB_A Master from TAB_A.ID
FK_TAB_B List(Select ID from TAB_B)

In TAB_A i insert 2 records, in TAB_NM i insert 1..3 records.

When i show in the Results i can see, some wrong entries in TAB_NM:

ID |FK_TAB_A |FK_TAB_B
1 |2000 |1
2 |2001 |1
3 |2001 |1
4 |2001 |2

So the Problem is in ID 2, 3. I have an unique Index on the column FK_TAB_A, FK_TAB_B, so if i insert the data i got an error from the index.

Is there a possibility to select "distinct" values for the column FK_TAB_B?
 
Back
Top