In Automation, when using the 'Enforce Referential Integrity' option of a Data Generator action, when a table is first added, SQL will be generated to lookup a random foreign key. However, if this automation action is closed and reopened, this functionality is lost.
e.g. on first setting up the Data Generator action, with 'Enforce Referential Integrity' option checked, the following SQL is displayed when clicking the 'Show SQL' button:
INSERT INTO SCOTT.EMP (
EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO
) VALUES (
6915, 'qA', 'tCP', 4591, TO_DATE('24-08-2008', 'DD-MM-YYYY'), 66352.33, 46259.65,
( SELECT DEPTNO FROM (SELECT DEPTNO FROM "SCOTT"."DEPT" ORDER BY DBMS_RANDOM.VALUE) WHERE rownum = 1 )
);
After clicking 'Apply' and 'Cancel' and then opening the action, the 'Show SQL', the following SQL is displayed:
INSERT INTO SCOTT.EMP (
EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO
) VALUES (
3033, 'ikWjZx', 'YZok', 1420, TO_DATE('09-03-2099', 'DD-MM-YYYY'), 51447.47,
4235.25, 53
);
The lookup SQL has been replaced with specific values.