 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[SA 6] - Generated data violates primary key |
|
I have a table with a compound primary key consisting of 3 columns. These are set to type 'lookup table' (they should be references to two other tables, but foreign keys are not defined). Data generator generated at least two records (out of 1000) that have all three columns matching in value.
|
|
Fri Aug 19, 2011 5:05 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
The data-generator doesn't generate sets of values for composite columns keys, it generates each column values independently. Can you set generation method for one of the column value to sequence to ensure that value is unique in every row and so is the composite key?
|
|
Thu Sep 01, 2011 11:49 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
 |
 |
The data-generator doesn't generate sets of values for composite columns keys, it generates each column values independently. Can you set generation method for one of the column value to sequence to ensure that value is unique in every row and so is the composite key? |
Good idea, I'll try that. By the way, is there way to specify a default minimum for datetime type columns when using sequence as Value Type? Not setting one results in SA generating the first value with missing date part (time part is present and it's '00:00:00') which causes the query to fail.
|
|
Fri Sep 02, 2011 2:56 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
It should be possible to specify min-max value range for all date and time based columns. Is that what you mean?
|
|
Fri Sep 02, 2011 5:01 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Not exactly. It is possible to specify those values manually but not specifying the minimum will generate a value for the first record that is considered invalid when inserting, though I don't understand why. The value is '00:00:00' (at least this one is shown in the preview) which should be perfectly fine. I'll save the script to see what does it do when it is executed from the studio, will update tomorrow.
UPDATE: there must have been some other issue(s), possibly related to some foreign keys. I created a test table and the test data generation ran without any problems.
|
|
Sat Sep 03, 2011 12:43 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|